jsgen: bool genConv generates boolean values instead of numeric (#7016)

This commit is contained in:
qqquinta
2018-01-03 13:40:19 +02:00
committed by Andreas Rumpf
parent 49a00fe6ff
commit d5f539dc87

View File

@@ -2051,10 +2051,10 @@ proc genConv(p: PProc, n: PNode, r: var TCompRes) =
return
case dest.kind:
of tyBool:
r.res = "(($1)? 1:0)" % [r.res]
r.res = "(!!($1))" % [r.res]
r.kind = resExpr
of tyInt:
r.res = "($1|0)" % [r.res]
r.res = "(($1)|0)" % [r.res]
else:
# TODO: What types must we handle here?
discard