acorn-bigint
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -0,1 +1,5 @@ | ||
## 0.4.0 (2019-04-04) | ||
* Make compatible with acorn-numeric-separator | ||
## 0.3.1 (2018-10-06) | ||
@@ -2,0 +6,0 @@ |
12
index.js
@@ -11,3 +11,3 @@ "use strict" | ||
const node = super.parseLiteral(value) | ||
if (node.raw.charCodeAt(node.raw.length - 1) == 110) node.bigint = node.raw | ||
if (node.raw.charCodeAt(node.raw.length - 1) == 110) node.bigint = this.getNumberInput(node.start, node.end) | ||
return node | ||
@@ -22,3 +22,3 @@ } | ||
if (this.input.charCodeAt(this.pos) == 110) { | ||
let str = this.input.slice(start, this.pos) | ||
let str = this.getNumberInput(start, this.pos) | ||
val = typeof BigInt !== "undefined" ? BigInt(str) : null | ||
@@ -49,3 +49,3 @@ ++this.pos | ||
let str = this.input.slice(start, this.pos) | ||
let str = this.getNumberInput(start, this.pos) | ||
let val = typeof BigInt !== "undefined" ? BigInt(str) : null | ||
@@ -55,3 +55,9 @@ ++this.pos | ||
} | ||
// This is basically a hook for acorn-numeric-separator | ||
getNumberInput(start, end) { | ||
if (super.getNumberInput) return super.getNumberInput(start, end) | ||
return this.input.slice(start, end) | ||
} | ||
} | ||
} |
@@ -24,11 +24,11 @@ { | ||
}, | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"devDependencies": { | ||
"acorn": "^6.0.0", | ||
"eslint": "^5.5.0", | ||
"eslint-plugin-node": "^7.0.1", | ||
"mocha": "^5.2.0", | ||
"test262": "git+https://github.com/tc39/test262.git#e286bfa00086226f781a3ed4e0a6295634b8ed11", | ||
"test262-parser-runner": "^0.4.0" | ||
"acorn": "^6.1.1", | ||
"eslint": "^5.16.0", | ||
"eslint-plugin-node": "^8.0.1", | ||
"mocha": "^6.0.2", | ||
"test262": "git+https://github.com/tc39/test262.git#611919174ffe060503691a0c7e3eb2a65b646124", | ||
"test262-parser-runner": "^0.5.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20487
552