jsgen: bool genConv generates boolean values instead of numeric (#7016)
This commit is contained in:
parent
49a00fe6ff
commit
d5f539dc87
1 changed files with 2 additions and 2 deletions
|
|
@ -2051,10 +2051,10 @@ proc genConv(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
return
|
return
|
||||||
case dest.kind:
|
case dest.kind:
|
||||||
of tyBool:
|
of tyBool:
|
||||||
r.res = "(($1)? 1:0)" % [r.res]
|
r.res = "(!!($1))" % [r.res]
|
||||||
r.kind = resExpr
|
r.kind = resExpr
|
||||||
of tyInt:
|
of tyInt:
|
||||||
r.res = "($1|0)" % [r.res]
|
r.res = "(($1)|0)" % [r.res]
|
||||||
else:
|
else:
|
||||||
# TODO: What types must we handle here?
|
# TODO: What types must we handle here?
|
||||||
discard
|
discard
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue