mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Merge pull request #3727 from yglukhov/js-bool-lit
Use real JS bool literals instead of 1 and 0. Fixes #3722.
This commit is contained in:
@@ -1636,7 +1636,10 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
|
||||
of nkSym:
|
||||
genSym(p, n, r)
|
||||
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
|
||||
of nkNilLit:
|
||||
if isEmptyType(n.typ):
|
||||
|
||||
Reference in New Issue
Block a user