Skip to content

Commit fe48e32

Browse files
committed
Fixed bigint generation on node < 10
1 parent 92c067e commit fe48e32

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

escodegen.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,11 @@
23482348
return '/' + expr.regex.pattern + '/' + expr.regex.flags;
23492349
}
23502350

2351+
// BigInt, eg: 1n
2352+
if (typeof expr.bigint === 'string' && expr.raw) {
2353+
return expr.raw;
2354+
}
2355+
23512356
if (expr.value === null) {
23522357
return 'null';
23532358
}
@@ -2356,11 +2361,6 @@
23562361
return escapeString(expr.value);
23572362
}
23582363

2359-
// BigInt, eg: 1n
2360-
if (typeof expr.bigint === 'string' && expr.raw) {
2361-
return expr.raw;
2362-
}
2363-
23642364
if (typeof expr.value === 'number') {
23652365
// Has Numeric Separator
23662366
if (expr.raw && expr.raw.indexOf('_') !== -1) {

0 commit comments

Comments
 (0)