diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/condsyms.nim | 1 | ||||
-rw-r--r-- | compiler/jsgen.nim | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index 131f32f32..55f2b4a0f 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -123,3 +123,4 @@ proc initDefines*(symbols: StringTableRef) = defineSymbol("nimHasEffectTraitsModule") defineSymbol("nimHasCastPragmaBlocks") defineSymbol("nimHasDeclaredLocs") + defineSymbol("nimHasJsBigIntBackend") diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 675a24c92..4b369210d 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -1677,7 +1677,10 @@ proc createVar(p: PProc, typ: PType, indirect: bool): Rope = var t = skipTypes(typ, abstractInst) case t.kind of tyInt..tyInt64, tyUInt..tyUInt64, tyEnum, tyChar: - result = putToSeq("0", indirect) + if $t.sym.loc.r == "bigint": + result = putToSeq("0n", indirect) + else: + result = putToSeq("0", indirect) of tyFloat..tyFloat128: result = putToSeq("0.0", indirect) of tyRange, tyGenericInst, tyAlias, tySink, tyOwned: |