From ab79c36169e37d8d964e0e4089f0b877ae0149ca Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Sun, 17 Jan 2016 10:44:04 +0200 Subject: [PATCH] Use real JS bool literals instead of 1 and 0. Fixes #3722. --- compiler/jsgen.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 2f6496b9b5..14cdf0174a 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -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):