mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
js: fix code generation for $if js
statements (#6896)
This commit is contained in:
parent
54df7d1daf
commit
4b19a6e00d
@ -1270,7 +1270,11 @@ fn (mut g JsGen) gen_if_expr(node ast.IfExpr) {
|
||||
}
|
||||
else {
|
||||
g.write('if (')
|
||||
g.expr(branch.cond)
|
||||
if '$branch.cond' == 'js' {
|
||||
g.write('true')
|
||||
} else {
|
||||
g.expr(branch.cond)
|
||||
}
|
||||
g.writeln(') {')
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user