meriyah 4.1.5 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +2 -1
- package/dist/meriyah.amd.js +96 -72
- package/dist/meriyah.amd.min.js +1 -1
- package/dist/meriyah.cjs +94 -70
- package/dist/meriyah.cjs.js +94 -70
- package/dist/meriyah.cjs.min.js +1 -1
- package/dist/meriyah.esm.js +94 -70
- package/dist/meriyah.esm.min.js +1 -1
- package/dist/meriyah.esm.min.mjs +1 -0
- package/dist/meriyah.esm.mjs +8806 -0
- package/dist/meriyah.iife.js +95 -71
- package/dist/meriyah.iife.min.js +1 -1
- package/dist/meriyah.min.cjs +1 -1
- package/dist/meriyah.system.js +98 -74
- package/dist/meriyah.system.min.js +1 -1
- package/dist/meriyah.umd.cjs +96 -72
- package/dist/meriyah.umd.es5.js +108 -80
- package/dist/meriyah.umd.es5.min.js +1 -15
- package/dist/meriyah.umd.js +96 -72
- package/dist/meriyah.umd.min.cjs +1 -1
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/estree.d.ts +9 -4
- package/dist/src/estree.d.ts.map +1 -1
- package/dist/src/lexer/regexp.d.ts.map +1 -1
- package/dist/src/parser.d.ts +1 -0
- package/dist/src/parser.d.ts.map +1 -1
- package/dist/src/token.d.ts +2 -2
- package/package.json +25 -30
- package/src/errors.ts +0 -2
- package/src/estree.ts +11 -3
- package/src/lexer/numeric.ts +7 -7
- package/src/lexer/regexp.ts +22 -9
- package/src/lexer/scan.ts +1 -1
- package/src/parser.ts +94 -56
- package/src/token.ts +2 -2
package/dist/meriyah.esm.js
CHANGED
|
@@ -94,7 +94,6 @@ const errorMessages = {
|
|
|
94
94
|
[89]: 'Illegal return statement',
|
|
95
95
|
[90]: 'The left hand side of the for-header binding declaration is not destructible',
|
|
96
96
|
[91]: 'new.target only allowed within functions',
|
|
97
|
-
[92]: "'Unexpected token: 'escaped keyword'",
|
|
98
97
|
[93]: "'#' not followed by identifier",
|
|
99
98
|
[99]: 'Invalid keyword',
|
|
100
99
|
[98]: "Can not use 'let' as a class name",
|
|
@@ -109,7 +108,6 @@ const errorMessages = {
|
|
|
109
108
|
[104]: "Only '*' or '{...}' can be imported after default",
|
|
110
109
|
[105]: 'Trailing decorator may be followed by method',
|
|
111
110
|
[106]: "Decorators can't be used with a constructor",
|
|
112
|
-
[107]: "'%0' may not be used as an identifier in this context",
|
|
113
111
|
[108]: 'HTML comments are only allowed with web compatibility (Annex B)',
|
|
114
112
|
[109]: "The identifier 'let' must not be in expression position in strict mode",
|
|
115
113
|
[110]: 'Cannot assign to `eval` and `arguments` in strict mode',
|
|
@@ -865,7 +863,7 @@ function scanRegularExpression(parser, context) {
|
|
|
865
863
|
break;
|
|
866
864
|
case 117:
|
|
867
865
|
if (mask & 16)
|
|
868
|
-
report(parser, 34, '
|
|
866
|
+
report(parser, 34, 'u');
|
|
869
867
|
mask |= 16;
|
|
870
868
|
break;
|
|
871
869
|
case 121:
|
|
@@ -874,9 +872,14 @@ function scanRegularExpression(parser, context) {
|
|
|
874
872
|
mask |= 8;
|
|
875
873
|
break;
|
|
876
874
|
case 115:
|
|
877
|
-
if (mask &
|
|
875
|
+
if (mask & 32)
|
|
878
876
|
report(parser, 34, 's');
|
|
879
|
-
mask |=
|
|
877
|
+
mask |= 32;
|
|
878
|
+
break;
|
|
879
|
+
case 100:
|
|
880
|
+
if (mask & 64)
|
|
881
|
+
report(parser, 34, 'd');
|
|
882
|
+
mask |= 64;
|
|
880
883
|
break;
|
|
881
884
|
default:
|
|
882
885
|
report(parser, 33);
|
|
@@ -896,7 +899,13 @@ function validate(parser, pattern, flags) {
|
|
|
896
899
|
return new RegExp(pattern, flags);
|
|
897
900
|
}
|
|
898
901
|
catch (e) {
|
|
899
|
-
|
|
902
|
+
try {
|
|
903
|
+
new RegExp(pattern, flags.replace('d', ''));
|
|
904
|
+
return null;
|
|
905
|
+
}
|
|
906
|
+
catch (e) {
|
|
907
|
+
report(parser, 32);
|
|
908
|
+
}
|
|
900
909
|
}
|
|
901
910
|
}
|
|
902
911
|
|
|
@@ -1207,8 +1216,8 @@ function scanNumber(parser, context, kind) {
|
|
|
1207
1216
|
digits++;
|
|
1208
1217
|
char = advanceChar(parser);
|
|
1209
1218
|
}
|
|
1210
|
-
if (digits
|
|
1211
|
-
report(parser, digits
|
|
1219
|
+
if (digits === 0 || !allowSeparator) {
|
|
1220
|
+
report(parser, digits === 0 ? 19 : 147);
|
|
1212
1221
|
}
|
|
1213
1222
|
}
|
|
1214
1223
|
else if ((char | 32) === 111) {
|
|
@@ -1228,8 +1237,8 @@ function scanNumber(parser, context, kind) {
|
|
|
1228
1237
|
digits++;
|
|
1229
1238
|
char = advanceChar(parser);
|
|
1230
1239
|
}
|
|
1231
|
-
if (digits
|
|
1232
|
-
report(parser, digits
|
|
1240
|
+
if (digits === 0 || !allowSeparator) {
|
|
1241
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1233
1242
|
}
|
|
1234
1243
|
}
|
|
1235
1244
|
else if ((char | 32) === 98) {
|
|
@@ -1249,8 +1258,8 @@ function scanNumber(parser, context, kind) {
|
|
|
1249
1258
|
digits++;
|
|
1250
1259
|
char = advanceChar(parser);
|
|
1251
1260
|
}
|
|
1252
|
-
if (digits
|
|
1253
|
-
report(parser, digits
|
|
1261
|
+
if (digits === 0 || !allowSeparator) {
|
|
1262
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1254
1263
|
}
|
|
1255
1264
|
}
|
|
1256
1265
|
else if (CharTypes[char] & 32) {
|
|
@@ -1326,7 +1335,7 @@ function scanNumber(parser, context, kind) {
|
|
|
1326
1335
|
if (CharTypes[char] & 256)
|
|
1327
1336
|
char = advanceChar(parser);
|
|
1328
1337
|
const { index } = parser;
|
|
1329
|
-
if ((CharTypes[char] & 16)
|
|
1338
|
+
if ((CharTypes[char] & 16) === 0)
|
|
1330
1339
|
report(parser, 10);
|
|
1331
1340
|
value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
|
|
1332
1341
|
char = parser.currentChar;
|
|
@@ -1789,7 +1798,7 @@ function scanSingleToken(parser, context, state) {
|
|
|
1789
1798
|
}
|
|
1790
1799
|
else if (ch === 61) {
|
|
1791
1800
|
advanceChar(parser);
|
|
1792
|
-
return
|
|
1801
|
+
return 8456256;
|
|
1793
1802
|
}
|
|
1794
1803
|
if (ch === 33) {
|
|
1795
1804
|
const index = parser.index + 1;
|
|
@@ -1807,7 +1816,7 @@ function scanSingleToken(parser, context, state) {
|
|
|
1807
1816
|
return 8456258;
|
|
1808
1817
|
}
|
|
1809
1818
|
if (ch === 47) {
|
|
1810
|
-
if ((context & 16)
|
|
1819
|
+
if ((context & 16) === 0)
|
|
1811
1820
|
return 8456258;
|
|
1812
1821
|
const index = parser.index + 1;
|
|
1813
1822
|
if (index < parser.end) {
|
|
@@ -1972,7 +1981,7 @@ function scanSingleToken(parser, context, state) {
|
|
|
1972
1981
|
const ch = parser.currentChar;
|
|
1973
1982
|
if (ch === 61) {
|
|
1974
1983
|
advanceChar(parser);
|
|
1975
|
-
return
|
|
1984
|
+
return 8456257;
|
|
1976
1985
|
}
|
|
1977
1986
|
if (ch !== 62)
|
|
1978
1987
|
return 8456259;
|
|
@@ -4913,7 +4922,7 @@ function parseStatement(parser, context, scope, origin, labels, allowFuncDecl, s
|
|
|
4913
4922
|
case 86106:
|
|
4914
4923
|
report(parser, context & 1024
|
|
4915
4924
|
? 73
|
|
4916
|
-
: (context & 256)
|
|
4925
|
+
: (context & 256) === 0
|
|
4917
4926
|
? 75
|
|
4918
4927
|
: 74);
|
|
4919
4928
|
case 86096:
|
|
@@ -4959,12 +4968,12 @@ function parseBlock(parser, context, scope, labels, start, line, column) {
|
|
|
4959
4968
|
});
|
|
4960
4969
|
}
|
|
4961
4970
|
function parseReturnStatement(parser, context, start, line, column) {
|
|
4962
|
-
if ((context & 32)
|
|
4971
|
+
if ((context & 32) === 0 && context & 8192)
|
|
4963
4972
|
report(parser, 89);
|
|
4964
4973
|
nextToken(parser, context | 32768);
|
|
4965
4974
|
const argument = parser.flags & 1 || parser.token & 1048576
|
|
4966
4975
|
? null
|
|
4967
|
-
: parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.
|
|
4976
|
+
: parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
|
|
4968
4977
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
4969
4978
|
return finishNode(parser, context, start, line, column, {
|
|
4970
4979
|
type: 'ReturnStatement',
|
|
@@ -4983,7 +4992,7 @@ function parseLabelledStatement(parser, context, scope, origin, labels, value, e
|
|
|
4983
4992
|
validateAndDeclareLabel(parser, labels, value);
|
|
4984
4993
|
nextToken(parser, context | 32768);
|
|
4985
4994
|
const body = allowFuncDecl &&
|
|
4986
|
-
(context & 1024)
|
|
4995
|
+
(context & 1024) === 0 &&
|
|
4987
4996
|
context & 256 &&
|
|
4988
4997
|
parser.token === 86106
|
|
4989
4998
|
? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
@@ -5092,7 +5101,7 @@ function parseIfStatement(parser, context, scope, labels, start, line, column) {
|
|
|
5092
5101
|
}
|
|
5093
5102
|
function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
|
|
5094
5103
|
return context & 1024 ||
|
|
5095
|
-
(context & 256)
|
|
5104
|
+
(context & 256) === 0 ||
|
|
5096
5105
|
parser.token !== 86106
|
|
5097
5106
|
? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
5098
5107
|
: parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
|
|
@@ -5157,11 +5166,11 @@ function parseIterationStatementBody(parser, context, scope, labels) {
|
|
|
5157
5166
|
return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5158
5167
|
}
|
|
5159
5168
|
function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
5160
|
-
if ((context & 131072)
|
|
5169
|
+
if ((context & 131072) === 0)
|
|
5161
5170
|
report(parser, 65);
|
|
5162
5171
|
nextToken(parser, context);
|
|
5163
5172
|
let label = null;
|
|
5164
|
-
if ((parser.flags & 1)
|
|
5173
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5165
5174
|
const { tokenValue } = parser;
|
|
5166
5175
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5167
5176
|
if (!isValidLabel(parser, labels, tokenValue, 1))
|
|
@@ -5176,13 +5185,13 @@ function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
|
5176
5185
|
function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
5177
5186
|
nextToken(parser, context | 32768);
|
|
5178
5187
|
let label = null;
|
|
5179
|
-
if ((parser.flags & 1)
|
|
5188
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5180
5189
|
const { tokenValue } = parser;
|
|
5181
5190
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5182
5191
|
if (!isValidLabel(parser, labels, tokenValue, 0))
|
|
5183
5192
|
report(parser, 134, tokenValue);
|
|
5184
5193
|
}
|
|
5185
|
-
else if ((context & (4096 | 131072))
|
|
5194
|
+
else if ((context & (4096 | 131072)) === 0) {
|
|
5186
5195
|
report(parser, 66);
|
|
5187
5196
|
}
|
|
5188
5197
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
@@ -5262,6 +5271,17 @@ function parseCatchBlock(parser, context, scope, labels, start, line, column) {
|
|
|
5262
5271
|
body
|
|
5263
5272
|
});
|
|
5264
5273
|
}
|
|
5274
|
+
function parseStaticBlock(parser, context, scope, start, line, column) {
|
|
5275
|
+
if (scope)
|
|
5276
|
+
scope = addChildScope(scope, 2);
|
|
5277
|
+
const ctorContext = 16384 | 524288;
|
|
5278
|
+
context = ((context | ctorContext) ^ ctorContext) | 262144;
|
|
5279
|
+
const { body } = parseBlock(parser, context, scope, {}, start, line, column);
|
|
5280
|
+
return finishNode(parser, context, start, line, column, {
|
|
5281
|
+
type: 'StaticBlock',
|
|
5282
|
+
body
|
|
5283
|
+
});
|
|
5284
|
+
}
|
|
5265
5285
|
function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
|
|
5266
5286
|
nextToken(parser, context | 32768);
|
|
5267
5287
|
const body = parseIterationStatementBody(parser, context, scope, labels);
|
|
@@ -5349,10 +5369,10 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
|
|
|
5349
5369
|
if (parser.token === 1077936157) {
|
|
5350
5370
|
nextToken(parser, context | 32768);
|
|
5351
5371
|
init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5352
|
-
if (origin & 32 || (token & 2097152)
|
|
5372
|
+
if (origin & 32 || (token & 2097152) === 0) {
|
|
5353
5373
|
if (parser.token === 274549 ||
|
|
5354
5374
|
(parser.token === 8738868 &&
|
|
5355
|
-
(token & 2097152 || (kind & 4)
|
|
5375
|
+
(token & 2097152 || (kind & 4) === 0 || context & 1024))) {
|
|
5356
5376
|
reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
|
|
5357
5377
|
}
|
|
5358
5378
|
}
|
|
@@ -5369,7 +5389,8 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
|
|
|
5369
5389
|
}
|
|
5370
5390
|
function parseForStatement(parser, context, scope, labels, start, line, column) {
|
|
5371
5391
|
nextToken(parser, context);
|
|
5372
|
-
const forAwait = (context & 4194304) > 0 &&
|
|
5392
|
+
const forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
|
|
5393
|
+
consumeOpt(parser, context, 209008);
|
|
5373
5394
|
consume(parser, context | 32768, 67174411);
|
|
5374
5395
|
if (scope)
|
|
5375
5396
|
scope = addChildScope(scope, 1);
|
|
@@ -5658,7 +5679,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5658
5679
|
const { tokenPos, linePos, colPos } = parser;
|
|
5659
5680
|
declaration = parseIdentifier(parser, context, 0);
|
|
5660
5681
|
const { flags } = parser;
|
|
5661
|
-
if ((flags & 1)
|
|
5682
|
+
if ((flags & 1) === 0) {
|
|
5662
5683
|
if (parser.token === 86106) {
|
|
5663
5684
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
|
|
5664
5685
|
}
|
|
@@ -5782,7 +5803,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5782
5803
|
case 209007:
|
|
5783
5804
|
const { tokenPos, linePos, colPos } = parser;
|
|
5784
5805
|
nextToken(parser, context);
|
|
5785
|
-
if ((parser.flags & 1)
|
|
5806
|
+
if ((parser.flags & 1) === 0 && parser.token === 86106) {
|
|
5786
5807
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
|
|
5787
5808
|
if (scope) {
|
|
5788
5809
|
key = declaration.id ? declaration.id.name : '';
|
|
@@ -5939,7 +5960,7 @@ function parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, isPatt
|
|
|
5939
5960
|
const { token } = parser;
|
|
5940
5961
|
const expr = parseIdentifier(parser, context, isPattern);
|
|
5941
5962
|
const { flags } = parser;
|
|
5942
|
-
if ((flags & 1)
|
|
5963
|
+
if ((flags & 1) === 0) {
|
|
5943
5964
|
if (parser.token === 86106) {
|
|
5944
5965
|
return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
|
|
5945
5966
|
}
|
|
@@ -5973,7 +5994,7 @@ function parseYieldExpression(parser, context, inGroup, canAssign, start, line,
|
|
|
5973
5994
|
report(parser, 120);
|
|
5974
5995
|
let argument = null;
|
|
5975
5996
|
let delegate = false;
|
|
5976
|
-
if ((parser.flags & 1)
|
|
5997
|
+
if ((parser.flags & 1) === 0) {
|
|
5977
5998
|
delegate = consumeOpt(parser, context | 32768, 8457014);
|
|
5978
5999
|
if (parser.token & (12288 | 65536) || delegate) {
|
|
5979
6000
|
argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
@@ -5993,7 +6014,7 @@ function parseYieldExpression(parser, context, inGroup, canAssign, start, line,
|
|
|
5993
6014
|
function parseAwaitExpression(parser, context, inNew, inGroup, start, line, column) {
|
|
5994
6015
|
if (inGroup)
|
|
5995
6016
|
parser.destructible |= 128;
|
|
5996
|
-
if (context & 4194304) {
|
|
6017
|
+
if (context & 4194304 || (context & 2048 && context & 8192)) {
|
|
5997
6018
|
if (inNew)
|
|
5998
6019
|
report(parser, 0);
|
|
5999
6020
|
if (context & 8388608) {
|
|
@@ -6001,6 +6022,8 @@ function parseAwaitExpression(parser, context, inNew, inGroup, start, line, colu
|
|
|
6001
6022
|
}
|
|
6002
6023
|
nextToken(parser, context | 32768);
|
|
6003
6024
|
const argument = parseLeftHandSideExpression(parser, context, 0, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6025
|
+
if (parser.token === 8457273)
|
|
6026
|
+
report(parser, 31);
|
|
6004
6027
|
parser.assignable = 2;
|
|
6005
6028
|
return finishNode(parser, context, start, line, column, {
|
|
6006
6029
|
type: 'AwaitExpression',
|
|
@@ -6008,7 +6031,7 @@ function parseAwaitExpression(parser, context, inNew, inGroup, start, line, colu
|
|
|
6008
6031
|
});
|
|
6009
6032
|
}
|
|
6010
6033
|
if (context & 2048)
|
|
6011
|
-
report(parser,
|
|
6034
|
+
report(parser, 95);
|
|
6012
6035
|
return parseIdentifierOrArrow(parser, context, start, line, column);
|
|
6013
6036
|
}
|
|
6014
6037
|
function parseFunctionBody(parser, context, scope, origin, firstRestricted, scopeError) {
|
|
@@ -6048,8 +6071,8 @@ function parseFunctionBody(parser, context, scope, origin, firstRestricted, scop
|
|
|
6048
6071
|
if (context & 64 &&
|
|
6049
6072
|
scope &&
|
|
6050
6073
|
scopeError !== void 0 &&
|
|
6051
|
-
(prevContext & 1024)
|
|
6052
|
-
(context & 8192)
|
|
6074
|
+
(prevContext & 1024) === 0 &&
|
|
6075
|
+
(context & 8192) === 0) {
|
|
6053
6076
|
reportScopeError(scopeError);
|
|
6054
6077
|
}
|
|
6055
6078
|
}
|
|
@@ -6075,19 +6098,19 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
6075
6098
|
case 67108991:
|
|
6076
6099
|
report(parser, 161);
|
|
6077
6100
|
case 67174411: {
|
|
6078
|
-
if ((context & 524288)
|
|
6101
|
+
if ((context & 524288) === 0)
|
|
6079
6102
|
report(parser, 26);
|
|
6080
6103
|
if (context & 16384)
|
|
6081
|
-
report(parser,
|
|
6104
|
+
report(parser, 27);
|
|
6082
6105
|
parser.assignable = 2;
|
|
6083
6106
|
break;
|
|
6084
6107
|
}
|
|
6085
6108
|
case 69271571:
|
|
6086
6109
|
case 67108877: {
|
|
6087
|
-
if ((context & 262144)
|
|
6110
|
+
if ((context & 262144) === 0)
|
|
6088
6111
|
report(parser, 27);
|
|
6089
6112
|
if (context & 16384)
|
|
6090
|
-
report(parser,
|
|
6113
|
+
report(parser, 27);
|
|
6091
6114
|
parser.assignable = 1;
|
|
6092
6115
|
break;
|
|
6093
6116
|
}
|
|
@@ -6114,14 +6137,14 @@ function parseUpdateExpression(parser, context, expr, start, line, column) {
|
|
|
6114
6137
|
});
|
|
6115
6138
|
}
|
|
6116
6139
|
function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain, start, line, column) {
|
|
6117
|
-
if ((parser.token & 33619968) === 33619968 && (parser.flags & 1)
|
|
6140
|
+
if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) === 0) {
|
|
6118
6141
|
expr = parseUpdateExpression(parser, context, expr, start, line, column);
|
|
6119
6142
|
}
|
|
6120
6143
|
else if ((parser.token & 67108864) === 67108864) {
|
|
6121
|
-
context = (context | 134217728
|
|
6144
|
+
context = (context | 134217728) ^ 134217728;
|
|
6122
6145
|
switch (parser.token) {
|
|
6123
6146
|
case 67108877: {
|
|
6124
|
-
nextToken(parser, context | 1073741824);
|
|
6147
|
+
nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
|
|
6125
6148
|
parser.assignable = 1;
|
|
6126
6149
|
const property = parsePropertyOrPrivatePropertyName(parser, context);
|
|
6127
6150
|
expr = finishNode(parser, context, start, line, column, {
|
|
@@ -6177,7 +6200,7 @@ function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain,
|
|
|
6177
6200
|
break;
|
|
6178
6201
|
}
|
|
6179
6202
|
case 67108991: {
|
|
6180
|
-
nextToken(parser, context);
|
|
6203
|
+
nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
|
|
6181
6204
|
parser.flags |= 2048;
|
|
6182
6205
|
parser.assignable = 2;
|
|
6183
6206
|
expr = parseOptionalChain(parser, context, expr, start, line, column);
|
|
@@ -6241,7 +6264,7 @@ function parseOptionalChain(parser, context, expr, start, line, column) {
|
|
|
6241
6264
|
});
|
|
6242
6265
|
}
|
|
6243
6266
|
else {
|
|
6244
|
-
if ((parser.token & (143360 | 4096))
|
|
6267
|
+
if ((parser.token & (143360 | 4096)) === 0)
|
|
6245
6268
|
report(parser, 154);
|
|
6246
6269
|
const property = parseIdentifier(parser, context, 0);
|
|
6247
6270
|
parser.assignable = 2;
|
|
@@ -6259,7 +6282,7 @@ function parseOptionalChain(parser, context, expr, start, line, column) {
|
|
|
6259
6282
|
return node;
|
|
6260
6283
|
}
|
|
6261
6284
|
function parsePropertyOrPrivatePropertyName(parser, context) {
|
|
6262
|
-
if ((parser.token & (143360 | 4096))
|
|
6285
|
+
if ((parser.token & (143360 | 4096)) === 0 && parser.token !== 131) {
|
|
6263
6286
|
report(parser, 154);
|
|
6264
6287
|
}
|
|
6265
6288
|
return context & 1 && parser.token === 131
|
|
@@ -6584,11 +6607,11 @@ function parseFunctionDeclaration(parser, context, scope, origin, allowGen, flag
|
|
|
6584
6607
|
let firstRestricted;
|
|
6585
6608
|
let functionScope = scope ? createScope() : void 0;
|
|
6586
6609
|
if (parser.token === 67174411) {
|
|
6587
|
-
if ((flags & 1)
|
|
6610
|
+
if ((flags & 1) === 0)
|
|
6588
6611
|
report(parser, 37, 'Function');
|
|
6589
6612
|
}
|
|
6590
6613
|
else {
|
|
6591
|
-
const kind = origin & 4 && ((context & 8192)
|
|
6614
|
+
const kind = origin & 4 && ((context & 8192) === 0 || (context & 2048) === 0)
|
|
6592
6615
|
? 4
|
|
6593
6616
|
: 64;
|
|
6594
6617
|
validateFunctionName(parser, context | ((context & 3072) << 11), parser.token);
|
|
@@ -6734,7 +6757,7 @@ function parseArrayExpressionOrPattern(parser, context, scope, skipInitializer,
|
|
|
6734
6757
|
destructible |=
|
|
6735
6758
|
kind & 1
|
|
6736
6759
|
? 32
|
|
6737
|
-
: (kind & 2)
|
|
6760
|
+
: (kind & 2) === 0
|
|
6738
6761
|
? 16
|
|
6739
6762
|
: 0;
|
|
6740
6763
|
left = parseMemberOrUpdateExpression(parser, context, left, inGroup, 0, tokenPos, linePos, colPos);
|
|
@@ -6793,7 +6816,7 @@ function parseArrayExpressionOrPattern(parser, context, scope, skipInitializer,
|
|
|
6793
6816
|
left = parseLeftHandSideExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
|
|
6794
6817
|
if (parser.token !== 18 && parser.token !== 20) {
|
|
6795
6818
|
left = parseAssignmentExpression(parser, context, inGroup, isPattern, tokenPos, linePos, colPos, left);
|
|
6796
|
-
if ((kind & (2 | 1))
|
|
6819
|
+
if ((kind & (2 | 1)) === 0 && token === 67174411)
|
|
6797
6820
|
destructible |= 16;
|
|
6798
6821
|
}
|
|
6799
6822
|
else if (parser.assignable & 2) {
|
|
@@ -6982,7 +7005,7 @@ function parseSpreadOrRestElement(parser, context, scope, closingToken, kind, or
|
|
|
6982
7005
|
});
|
|
6983
7006
|
}
|
|
6984
7007
|
function parseMethodDefinition(parser, context, kind, inGroup, start, line, column) {
|
|
6985
|
-
const modifierFlags = (kind & 64)
|
|
7008
|
+
const modifierFlags = (kind & 64) === 0 ? 31981568 : 14680064;
|
|
6986
7009
|
context =
|
|
6987
7010
|
((context | modifierFlags) ^ modifierFlags) |
|
|
6988
7011
|
((kind & 88) << 18) |
|
|
@@ -7550,7 +7573,7 @@ function parseMethodFormals(parser, context, scope, kind, type, inGroup) {
|
|
|
7550
7573
|
let left = null;
|
|
7551
7574
|
const { tokenPos, linePos, colPos } = parser;
|
|
7552
7575
|
if (parser.token & 143360) {
|
|
7553
|
-
if ((context & 1024)
|
|
7576
|
+
if ((context & 1024) === 0) {
|
|
7554
7577
|
if ((parser.token & 36864) === 36864) {
|
|
7555
7578
|
parser.flags |= 256;
|
|
7556
7579
|
}
|
|
@@ -7613,7 +7636,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7613
7636
|
const { tokenPos: piStart, linePos: plStart, colPos: pcStart } = parser;
|
|
7614
7637
|
nextToken(parser, context | 32768 | 1073741824);
|
|
7615
7638
|
const scope = context & 64 ? addChildScope(createScope(), 1024) : void 0;
|
|
7616
|
-
context = (context | 134217728
|
|
7639
|
+
context = (context | 134217728) ^ 134217728;
|
|
7617
7640
|
if (consumeOpt(parser, context, 16)) {
|
|
7618
7641
|
return parseParenthesizedArrow(parser, context, scope, [], canAssign, 0, start, line, column);
|
|
7619
7642
|
}
|
|
@@ -7811,7 +7834,7 @@ function parseArrowFunctionExpression(parser, context, scope, params, isAsync, s
|
|
|
7811
7834
|
(134221824 | 8192 | 16384), scope, 16, void 0, void 0);
|
|
7812
7835
|
switch (parser.token) {
|
|
7813
7836
|
case 69271571:
|
|
7814
|
-
if ((parser.flags & 1)
|
|
7837
|
+
if ((parser.flags & 1) === 0) {
|
|
7815
7838
|
report(parser, 112);
|
|
7816
7839
|
}
|
|
7817
7840
|
break;
|
|
@@ -7820,13 +7843,13 @@ function parseArrowFunctionExpression(parser, context, scope, params, isAsync, s
|
|
|
7820
7843
|
case 22:
|
|
7821
7844
|
report(parser, 113);
|
|
7822
7845
|
case 67174411:
|
|
7823
|
-
if ((parser.flags & 1)
|
|
7846
|
+
if ((parser.flags & 1) === 0) {
|
|
7824
7847
|
report(parser, 112);
|
|
7825
7848
|
}
|
|
7826
7849
|
parser.flags |= 1024;
|
|
7827
7850
|
break;
|
|
7828
7851
|
}
|
|
7829
|
-
if ((parser.token & 8454144) === 8454144 && (parser.flags & 1)
|
|
7852
|
+
if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) === 0)
|
|
7830
7853
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
7831
7854
|
if ((parser.token & 33619968) === 33619968)
|
|
7832
7855
|
report(parser, 121);
|
|
@@ -7852,7 +7875,7 @@ function parseFormalParametersOrFormalList(parser, context, scope, inGroup, kind
|
|
|
7852
7875
|
let left;
|
|
7853
7876
|
const { tokenPos, linePos, colPos } = parser;
|
|
7854
7877
|
if (parser.token & 143360) {
|
|
7855
|
-
if ((context & 1024)
|
|
7878
|
+
if ((context & 1024) === 0) {
|
|
7856
7879
|
if ((parser.token & 36864) === 36864) {
|
|
7857
7880
|
parser.flags |= 256;
|
|
7858
7881
|
}
|
|
@@ -8172,7 +8195,7 @@ function parseClassDeclaration(parser, context, scope, flags, start, line, colum
|
|
|
8172
8195
|
id = parseIdentifier(parser, context, 0);
|
|
8173
8196
|
}
|
|
8174
8197
|
else {
|
|
8175
|
-
if ((flags & 1)
|
|
8198
|
+
if ((flags & 1) === 0)
|
|
8176
8199
|
report(parser, 37, 'Class');
|
|
8177
8200
|
}
|
|
8178
8201
|
let inheritedContext = context;
|
|
@@ -8303,7 +8326,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8303
8326
|
}
|
|
8304
8327
|
break;
|
|
8305
8328
|
case 209007:
|
|
8306
|
-
if (parser.token !== 67174411 && (parser.flags & 1)
|
|
8329
|
+
if (parser.token !== 67174411 && (parser.flags & 1) === 0) {
|
|
8307
8330
|
if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8308
8331
|
return parsePropertyDefinition(parser, context, key, kind, decorators, tokenPos, linePos, colPos);
|
|
8309
8332
|
}
|
|
@@ -8341,12 +8364,13 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8341
8364
|
}
|
|
8342
8365
|
else if (context & 1 && parser.token === 131) {
|
|
8343
8366
|
kind |= 4096;
|
|
8344
|
-
key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
|
|
8345
|
-
context = context | 16384;
|
|
8367
|
+
key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
|
|
8346
8368
|
}
|
|
8347
8369
|
else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8348
8370
|
kind |= 128;
|
|
8349
|
-
|
|
8371
|
+
}
|
|
8372
|
+
else if (isStatic && token === 2162700) {
|
|
8373
|
+
return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
|
|
8350
8374
|
}
|
|
8351
8375
|
else if (token === 122) {
|
|
8352
8376
|
key = parseIdentifier(parser, context, 0);
|
|
@@ -8377,16 +8401,16 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8377
8401
|
else
|
|
8378
8402
|
report(parser, 131);
|
|
8379
8403
|
}
|
|
8380
|
-
if ((kind & 2)
|
|
8404
|
+
if ((kind & 2) === 0) {
|
|
8381
8405
|
if (parser.tokenValue === 'constructor') {
|
|
8382
8406
|
if ((parser.token & 1073741824) === 1073741824) {
|
|
8383
8407
|
report(parser, 125);
|
|
8384
8408
|
}
|
|
8385
|
-
else if ((kind & 32)
|
|
8409
|
+
else if ((kind & 32) === 0 && parser.token === 67174411) {
|
|
8386
8410
|
if (kind & (768 | 16 | 128 | 8)) {
|
|
8387
8411
|
report(parser, 50, 'accessor');
|
|
8388
8412
|
}
|
|
8389
|
-
else if ((context & 524288)
|
|
8413
|
+
else if ((context & 524288) === 0) {
|
|
8390
8414
|
if (parser.flags & 32)
|
|
8391
8415
|
report(parser, 51);
|
|
8392
8416
|
else
|
|
@@ -8395,7 +8419,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8395
8419
|
}
|
|
8396
8420
|
kind |= 64;
|
|
8397
8421
|
}
|
|
8398
|
-
else if ((kind & 4096)
|
|
8422
|
+
else if ((kind & 4096) === 0 &&
|
|
8399
8423
|
kind & (32 | 768 | 8 | 16) &&
|
|
8400
8424
|
parser.tokenValue === 'prototype') {
|
|
8401
8425
|
report(parser, 49);
|
|
@@ -8408,7 +8432,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8408
8432
|
return finishNode(parser, context, start, line, column, context & 1
|
|
8409
8433
|
? {
|
|
8410
8434
|
type: 'MethodDefinition',
|
|
8411
|
-
kind: (kind & 32)
|
|
8435
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8412
8436
|
? 'constructor'
|
|
8413
8437
|
: kind & 256
|
|
8414
8438
|
? 'get'
|
|
@@ -8423,7 +8447,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8423
8447
|
}
|
|
8424
8448
|
: {
|
|
8425
8449
|
type: 'MethodDefinition',
|
|
8426
|
-
kind: (kind & 32)
|
|
8450
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8427
8451
|
? 'constructor'
|
|
8428
8452
|
: kind & 256
|
|
8429
8453
|
? 'get'
|
|
@@ -8712,7 +8736,7 @@ function parseJSXNamespacedName(parser, context, namespace, start, line, column)
|
|
|
8712
8736
|
});
|
|
8713
8737
|
}
|
|
8714
8738
|
function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
|
|
8715
|
-
nextToken(parser, context);
|
|
8739
|
+
nextToken(parser, context | 32768);
|
|
8716
8740
|
const { tokenPos, linePos, colPos } = parser;
|
|
8717
8741
|
if (parser.token === 14)
|
|
8718
8742
|
return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
|
|
@@ -8766,7 +8790,7 @@ var estree = /*#__PURE__*/Object.freeze({
|
|
|
8766
8790
|
__proto__: null
|
|
8767
8791
|
});
|
|
8768
8792
|
|
|
8769
|
-
var version$1 = "4.
|
|
8793
|
+
var version$1 = "4.3.0";
|
|
8770
8794
|
|
|
8771
8795
|
const version = version$1;
|
|
8772
8796
|
function parseScript(source, options) {
|