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:
Andreas Rumpf 2016-01-17 17:06:03 +01:00
commit cc2decbbbc

View file

@ -1636,6 +1636,9 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
of nkSym:
genSym(p, n, r)
of nkCharLit..nkInt64Lit:
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: