mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix hardcoded app
param name in code generated for vweb.html (#15766)
This commit is contained in:
parent
7f30519544
commit
0b6924ebfb
@ -70,7 +70,8 @@ fn (mut g Gen) comptime_call(mut node ast.ComptimeCall) {
|
||||
fn_name := g.fn_decl.name.replace('.', '__') + node.pos.pos.str()
|
||||
if is_html {
|
||||
// return vweb html template
|
||||
g.writeln('vweb__Context_html(&app->Context, _tmpl_res_$fn_name); strings__Builder_free(&sb_$fn_name); string_free(&_tmpl_res_$fn_name);')
|
||||
app_name := g.fn_decl.params[0].name
|
||||
g.writeln('vweb__Context_html(&$app_name->Context, _tmpl_res_$fn_name); strings__Builder_free(&sb_$fn_name); string_free(&_tmpl_res_$fn_name);')
|
||||
} else {
|
||||
// return $tmpl string
|
||||
g.write(cur_line)
|
||||
|
Loading…
Reference in New Issue
Block a user