Parse BigInts by default (#11117)
This commit is contained in:
parent
1971b7e87d
commit
2bce1e5e20
@ -996,11 +996,9 @@ export default class Tokenizer extends LocationParser {
|
|||||||
this.raise(this.state.start + 2, Errors.InvalidDigit, radix);
|
this.raise(this.state.start + 2, Errors.InvalidDigit, radix);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasPlugin("bigInt")) {
|
if (this.input.charCodeAt(this.state.pos) === charCodes.lowercaseN) {
|
||||||
if (this.input.charCodeAt(this.state.pos) === charCodes.lowercaseN) {
|
++this.state.pos;
|
||||||
++this.state.pos;
|
isBigInt = true;
|
||||||
isBigInt = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
|
if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
|
||||||
@ -1071,16 +1069,14 @@ export default class Tokenizer extends LocationParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasPlugin("bigInt")) {
|
if (next === charCodes.lowercaseN) {
|
||||||
if (next === charCodes.lowercaseN) {
|
// disallow floats, legacy octal syntax and non octal decimals
|
||||||
// disallow floats, legacy octal syntax and non octal decimals
|
// new style octal ("0o") is handled in this.readRadixNumber
|
||||||
// new style octal ("0o") is handled in this.readRadixNumber
|
if (isFloat || octal || isNonOctalDecimalInt) {
|
||||||
if (isFloat || octal || isNonOctalDecimalInt) {
|
this.raise(start, "Invalid BigIntLiteral");
|
||||||
this.raise(start, "Invalid BigIntLiteral");
|
|
||||||
}
|
|
||||||
++this.state.pos;
|
|
||||||
isBigInt = true;
|
|
||||||
}
|
}
|
||||||
|
++this.state.pos;
|
||||||
|
isBigInt = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
|
if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["estree", "bigInt"]
|
"plugins": ["estree"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": ["bigInt"]
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": ["bigInt"]
|
|
||||||
}
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["bigInt", "numericSeparator"]
|
"plugins": ["numericSeparator"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["bigInt", "numericSeparator"]
|
"plugins": ["numericSeparator"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["bigInt", "numericSeparator"]
|
"plugins": ["numericSeparator"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["bigInt", "numericSeparator"]
|
"plugins": ["numericSeparator"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["bigInt", "numericSeparator"]
|
"plugins": ["numericSeparator"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["bigInt", "numericSeparator"]
|
"plugins": ["numericSeparator"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["bigInt", "numericSeparator"]
|
"plugins": ["numericSeparator"]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user