Skip to content

Commit df76dc7

Browse files
committed
[js] Fix 64bit integer literals
1 parent 4a20f57 commit df76dc7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/vm/js/Compiler.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
14171417

14181418
multi method as_js(QAST::IVal $node, :$want) {
14191419
if $want == $T_INT64 || $want == $T_UINT64 {
1420-
Chunk.new($want,'('~$node.value()~'n)', :$node);
1420+
Chunk.new($want,'nqp.BigInt("'~$node.value()~'")', :$node);
14211421
} else {
14221422
# TODO think about 64bit values
14231423
Chunk.new($T_INT,'('~$node.value()~')', :$node);

src/vm/js/nqp-runtime/runtime.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ exports.createSourceMap = core.createSourceMap;
836836
exports.ZERO = JSBI.BigInt(0);
837837
exports.asIntN = asIntN.asIntN;
838838
exports.asUintN = asIntN.asUintN;
839+
exports.BigInt = JSBI.BigInt;
839840

840841
module.exports.freshGlobalContext = globalContext.freshGlobalContext;
841842
module.exports.setGlobalContext = globalContext.setGlobalContext;

0 commit comments

Comments
 (0)