Use real JS bool literals instead of 1 and 0. Fixes #3722.
This commit is contained in:
parent
34a783a61c
commit
ab79c36169
1 changed files with 4 additions and 1 deletions
|
|
@ -1636,7 +1636,10 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
of nkSym:
|
of nkSym:
|
||||||
genSym(p, n, r)
|
genSym(p, n, r)
|
||||||
of nkCharLit..nkInt64Lit:
|
of nkCharLit..nkInt64Lit:
|
||||||
r.res = rope(n.intVal)
|
if n.typ.kind == tyBool:
|
||||||
|
r.res = if n.intVal == 0: rope"false" else: rope"true"
|
||||||
|
else:
|
||||||
|
r.res = rope(n.intVal)
|
||||||
r.kind = resExpr
|
r.kind = resExpr
|
||||||
of nkNilLit:
|
of nkNilLit:
|
||||||
if isEmptyType(n.typ):
|
if isEmptyType(n.typ):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue