meriyah 4.2.0 → 4.3.1
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 +40 -0
- package/README.md +2 -1
- package/dist/meriyah.amd.js +119 -81
- package/dist/meriyah.amd.min.js +1 -1
- package/dist/meriyah.cjs +117 -79
- package/dist/meriyah.cjs.js +117 -79
- package/dist/meriyah.cjs.min.js +1 -1
- package/dist/meriyah.esm.js +117 -79
- package/dist/meriyah.esm.min.js +1 -1
- package/dist/meriyah.esm.min.mjs +1 -0
- package/dist/meriyah.esm.mjs +8820 -0
- package/dist/meriyah.iife.js +118 -80
- package/dist/meriyah.iife.min.js +1 -1
- package/dist/meriyah.min.cjs +1 -1
- package/dist/meriyah.system.js +121 -83
- package/dist/meriyah.system.min.js +1 -1
- package/dist/meriyah.umd.cjs +119 -81
- package/dist/meriyah.umd.es5.js +131 -89
- package/dist/meriyah.umd.es5.min.js +1 -15
- package/dist/meriyah.umd.js +119 -81
- package/dist/meriyah.umd.min.cjs +1 -1
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/src/estree.d.ts +9 -4
- package/dist/src/estree.d.ts.map +1 -1
- package/dist/src/lexer/identifier.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/estree.ts +11 -3
- package/src/lexer/identifier.ts +33 -14
- 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 +89 -52
- package/src/token.ts +3 -3
package/dist/meriyah.esm.js
CHANGED
|
@@ -863,7 +863,7 @@ function scanRegularExpression(parser, context) {
|
|
|
863
863
|
break;
|
|
864
864
|
case 117:
|
|
865
865
|
if (mask & 16)
|
|
866
|
-
report(parser, 34, '
|
|
866
|
+
report(parser, 34, 'u');
|
|
867
867
|
mask |= 16;
|
|
868
868
|
break;
|
|
869
869
|
case 121:
|
|
@@ -872,9 +872,14 @@ function scanRegularExpression(parser, context) {
|
|
|
872
872
|
mask |= 8;
|
|
873
873
|
break;
|
|
874
874
|
case 115:
|
|
875
|
-
if (mask &
|
|
875
|
+
if (mask & 32)
|
|
876
876
|
report(parser, 34, 's');
|
|
877
|
-
mask |=
|
|
877
|
+
mask |= 32;
|
|
878
|
+
break;
|
|
879
|
+
case 100:
|
|
880
|
+
if (mask & 64)
|
|
881
|
+
report(parser, 34, 'd');
|
|
882
|
+
mask |= 64;
|
|
878
883
|
break;
|
|
879
884
|
default:
|
|
880
885
|
report(parser, 33);
|
|
@@ -894,7 +899,13 @@ function validate(parser, pattern, flags) {
|
|
|
894
899
|
return new RegExp(pattern, flags);
|
|
895
900
|
}
|
|
896
901
|
catch (e) {
|
|
897
|
-
|
|
902
|
+
try {
|
|
903
|
+
new RegExp(pattern, flags.replace('d', ''));
|
|
904
|
+
return null;
|
|
905
|
+
}
|
|
906
|
+
catch (e) {
|
|
907
|
+
report(parser, 32);
|
|
908
|
+
}
|
|
898
909
|
}
|
|
899
910
|
}
|
|
900
911
|
|
|
@@ -1205,8 +1216,8 @@ function scanNumber(parser, context, kind) {
|
|
|
1205
1216
|
digits++;
|
|
1206
1217
|
char = advanceChar(parser);
|
|
1207
1218
|
}
|
|
1208
|
-
if (digits
|
|
1209
|
-
report(parser, digits
|
|
1219
|
+
if (digits === 0 || !allowSeparator) {
|
|
1220
|
+
report(parser, digits === 0 ? 19 : 147);
|
|
1210
1221
|
}
|
|
1211
1222
|
}
|
|
1212
1223
|
else if ((char | 32) === 111) {
|
|
@@ -1226,8 +1237,8 @@ function scanNumber(parser, context, kind) {
|
|
|
1226
1237
|
digits++;
|
|
1227
1238
|
char = advanceChar(parser);
|
|
1228
1239
|
}
|
|
1229
|
-
if (digits
|
|
1230
|
-
report(parser, digits
|
|
1240
|
+
if (digits === 0 || !allowSeparator) {
|
|
1241
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1231
1242
|
}
|
|
1232
1243
|
}
|
|
1233
1244
|
else if ((char | 32) === 98) {
|
|
@@ -1247,8 +1258,8 @@ function scanNumber(parser, context, kind) {
|
|
|
1247
1258
|
digits++;
|
|
1248
1259
|
char = advanceChar(parser);
|
|
1249
1260
|
}
|
|
1250
|
-
if (digits
|
|
1251
|
-
report(parser, digits
|
|
1261
|
+
if (digits === 0 || !allowSeparator) {
|
|
1262
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1252
1263
|
}
|
|
1253
1264
|
}
|
|
1254
1265
|
else if (CharTypes[char] & 32) {
|
|
@@ -1324,7 +1335,7 @@ function scanNumber(parser, context, kind) {
|
|
|
1324
1335
|
if (CharTypes[char] & 256)
|
|
1325
1336
|
char = advanceChar(parser);
|
|
1326
1337
|
const { index } = parser;
|
|
1327
|
-
if ((CharTypes[char] & 16)
|
|
1338
|
+
if ((CharTypes[char] & 16) === 0)
|
|
1328
1339
|
report(parser, 10);
|
|
1329
1340
|
value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
|
|
1330
1341
|
char = parser.currentChar;
|
|
@@ -1498,14 +1509,28 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
|
|
|
1498
1509
|
return 208897;
|
|
1499
1510
|
if (!hasEscape)
|
|
1500
1511
|
return token;
|
|
1512
|
+
if (token === 209008) {
|
|
1513
|
+
if ((context & (2048 | 4194304)) === 0) {
|
|
1514
|
+
return token;
|
|
1515
|
+
}
|
|
1516
|
+
return 121;
|
|
1517
|
+
}
|
|
1501
1518
|
if (context & 1024) {
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1519
|
+
if (token === 36972) {
|
|
1520
|
+
return 122;
|
|
1521
|
+
}
|
|
1522
|
+
if ((token & 36864) === 36864) {
|
|
1523
|
+
return 122;
|
|
1524
|
+
}
|
|
1525
|
+
if ((token & 20480) === 20480) {
|
|
1526
|
+
if (context & 1073741824 && (context & 8192) === 0) {
|
|
1527
|
+
return token;
|
|
1528
|
+
}
|
|
1529
|
+
else {
|
|
1530
|
+
return 121;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
return 143483;
|
|
1509
1534
|
}
|
|
1510
1535
|
if (context & 1073741824 &&
|
|
1511
1536
|
(context & 8192) === 0 &&
|
|
@@ -1518,13 +1543,13 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
|
|
|
1518
1543
|
? 121
|
|
1519
1544
|
: token;
|
|
1520
1545
|
}
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1546
|
+
if (token === 209007) {
|
|
1547
|
+
return 143483;
|
|
1548
|
+
}
|
|
1549
|
+
if ((token & 36864) === 36864) {
|
|
1550
|
+
return token;
|
|
1551
|
+
}
|
|
1552
|
+
return 121;
|
|
1528
1553
|
}
|
|
1529
1554
|
return 208897;
|
|
1530
1555
|
}
|
|
@@ -1787,7 +1812,7 @@ function scanSingleToken(parser, context, state) {
|
|
|
1787
1812
|
}
|
|
1788
1813
|
else if (ch === 61) {
|
|
1789
1814
|
advanceChar(parser);
|
|
1790
|
-
return
|
|
1815
|
+
return 8456256;
|
|
1791
1816
|
}
|
|
1792
1817
|
if (ch === 33) {
|
|
1793
1818
|
const index = parser.index + 1;
|
|
@@ -1805,7 +1830,7 @@ function scanSingleToken(parser, context, state) {
|
|
|
1805
1830
|
return 8456258;
|
|
1806
1831
|
}
|
|
1807
1832
|
if (ch === 47) {
|
|
1808
|
-
if ((context & 16)
|
|
1833
|
+
if ((context & 16) === 0)
|
|
1809
1834
|
return 8456258;
|
|
1810
1835
|
const index = parser.index + 1;
|
|
1811
1836
|
if (index < parser.end) {
|
|
@@ -1970,7 +1995,7 @@ function scanSingleToken(parser, context, state) {
|
|
|
1970
1995
|
const ch = parser.currentChar;
|
|
1971
1996
|
if (ch === 61) {
|
|
1972
1997
|
advanceChar(parser);
|
|
1973
|
-
return
|
|
1998
|
+
return 8456257;
|
|
1974
1999
|
}
|
|
1975
2000
|
if (ch !== 62)
|
|
1976
2001
|
return 8456259;
|
|
@@ -4911,7 +4936,7 @@ function parseStatement(parser, context, scope, origin, labels, allowFuncDecl, s
|
|
|
4911
4936
|
case 86106:
|
|
4912
4937
|
report(parser, context & 1024
|
|
4913
4938
|
? 73
|
|
4914
|
-
: (context & 256)
|
|
4939
|
+
: (context & 256) === 0
|
|
4915
4940
|
? 75
|
|
4916
4941
|
: 74);
|
|
4917
4942
|
case 86096:
|
|
@@ -4957,12 +4982,12 @@ function parseBlock(parser, context, scope, labels, start, line, column) {
|
|
|
4957
4982
|
});
|
|
4958
4983
|
}
|
|
4959
4984
|
function parseReturnStatement(parser, context, start, line, column) {
|
|
4960
|
-
if ((context & 32)
|
|
4985
|
+
if ((context & 32) === 0 && context & 8192)
|
|
4961
4986
|
report(parser, 89);
|
|
4962
4987
|
nextToken(parser, context | 32768);
|
|
4963
4988
|
const argument = parser.flags & 1 || parser.token & 1048576
|
|
4964
4989
|
? null
|
|
4965
|
-
: parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.
|
|
4990
|
+
: parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
|
|
4966
4991
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
4967
4992
|
return finishNode(parser, context, start, line, column, {
|
|
4968
4993
|
type: 'ReturnStatement',
|
|
@@ -4981,7 +5006,7 @@ function parseLabelledStatement(parser, context, scope, origin, labels, value, e
|
|
|
4981
5006
|
validateAndDeclareLabel(parser, labels, value);
|
|
4982
5007
|
nextToken(parser, context | 32768);
|
|
4983
5008
|
const body = allowFuncDecl &&
|
|
4984
|
-
(context & 1024)
|
|
5009
|
+
(context & 1024) === 0 &&
|
|
4985
5010
|
context & 256 &&
|
|
4986
5011
|
parser.token === 86106
|
|
4987
5012
|
? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
@@ -5090,7 +5115,7 @@ function parseIfStatement(parser, context, scope, labels, start, line, column) {
|
|
|
5090
5115
|
}
|
|
5091
5116
|
function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
|
|
5092
5117
|
return context & 1024 ||
|
|
5093
|
-
(context & 256)
|
|
5118
|
+
(context & 256) === 0 ||
|
|
5094
5119
|
parser.token !== 86106
|
|
5095
5120
|
? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
5096
5121
|
: parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
|
|
@@ -5155,11 +5180,11 @@ function parseIterationStatementBody(parser, context, scope, labels) {
|
|
|
5155
5180
|
return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5156
5181
|
}
|
|
5157
5182
|
function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
5158
|
-
if ((context & 131072)
|
|
5183
|
+
if ((context & 131072) === 0)
|
|
5159
5184
|
report(parser, 65);
|
|
5160
5185
|
nextToken(parser, context);
|
|
5161
5186
|
let label = null;
|
|
5162
|
-
if ((parser.flags & 1)
|
|
5187
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5163
5188
|
const { tokenValue } = parser;
|
|
5164
5189
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5165
5190
|
if (!isValidLabel(parser, labels, tokenValue, 1))
|
|
@@ -5174,13 +5199,13 @@ function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
|
5174
5199
|
function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
5175
5200
|
nextToken(parser, context | 32768);
|
|
5176
5201
|
let label = null;
|
|
5177
|
-
if ((parser.flags & 1)
|
|
5202
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5178
5203
|
const { tokenValue } = parser;
|
|
5179
5204
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5180
5205
|
if (!isValidLabel(parser, labels, tokenValue, 0))
|
|
5181
5206
|
report(parser, 134, tokenValue);
|
|
5182
5207
|
}
|
|
5183
|
-
else if ((context & (4096 | 131072))
|
|
5208
|
+
else if ((context & (4096 | 131072)) === 0) {
|
|
5184
5209
|
report(parser, 66);
|
|
5185
5210
|
}
|
|
5186
5211
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
@@ -5260,6 +5285,17 @@ function parseCatchBlock(parser, context, scope, labels, start, line, column) {
|
|
|
5260
5285
|
body
|
|
5261
5286
|
});
|
|
5262
5287
|
}
|
|
5288
|
+
function parseStaticBlock(parser, context, scope, start, line, column) {
|
|
5289
|
+
if (scope)
|
|
5290
|
+
scope = addChildScope(scope, 2);
|
|
5291
|
+
const ctorContext = 16384 | 524288;
|
|
5292
|
+
context = ((context | ctorContext) ^ ctorContext) | 262144;
|
|
5293
|
+
const { body } = parseBlock(parser, context, scope, {}, start, line, column);
|
|
5294
|
+
return finishNode(parser, context, start, line, column, {
|
|
5295
|
+
type: 'StaticBlock',
|
|
5296
|
+
body
|
|
5297
|
+
});
|
|
5298
|
+
}
|
|
5263
5299
|
function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
|
|
5264
5300
|
nextToken(parser, context | 32768);
|
|
5265
5301
|
const body = parseIterationStatementBody(parser, context, scope, labels);
|
|
@@ -5347,10 +5383,10 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
|
|
|
5347
5383
|
if (parser.token === 1077936157) {
|
|
5348
5384
|
nextToken(parser, context | 32768);
|
|
5349
5385
|
init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5350
|
-
if (origin & 32 || (token & 2097152)
|
|
5386
|
+
if (origin & 32 || (token & 2097152) === 0) {
|
|
5351
5387
|
if (parser.token === 274549 ||
|
|
5352
5388
|
(parser.token === 8738868 &&
|
|
5353
|
-
(token & 2097152 || (kind & 4)
|
|
5389
|
+
(token & 2097152 || (kind & 4) === 0 || context & 1024))) {
|
|
5354
5390
|
reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
|
|
5355
5391
|
}
|
|
5356
5392
|
}
|
|
@@ -5367,7 +5403,8 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
|
|
|
5367
5403
|
}
|
|
5368
5404
|
function parseForStatement(parser, context, scope, labels, start, line, column) {
|
|
5369
5405
|
nextToken(parser, context);
|
|
5370
|
-
const forAwait = (context & 4194304) > 0 &&
|
|
5406
|
+
const forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
|
|
5407
|
+
consumeOpt(parser, context, 209008);
|
|
5371
5408
|
consume(parser, context | 32768, 67174411);
|
|
5372
5409
|
if (scope)
|
|
5373
5410
|
scope = addChildScope(scope, 1);
|
|
@@ -5656,7 +5693,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5656
5693
|
const { tokenPos, linePos, colPos } = parser;
|
|
5657
5694
|
declaration = parseIdentifier(parser, context, 0);
|
|
5658
5695
|
const { flags } = parser;
|
|
5659
|
-
if ((flags & 1)
|
|
5696
|
+
if ((flags & 1) === 0) {
|
|
5660
5697
|
if (parser.token === 86106) {
|
|
5661
5698
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
|
|
5662
5699
|
}
|
|
@@ -5780,7 +5817,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5780
5817
|
case 209007:
|
|
5781
5818
|
const { tokenPos, linePos, colPos } = parser;
|
|
5782
5819
|
nextToken(parser, context);
|
|
5783
|
-
if ((parser.flags & 1)
|
|
5820
|
+
if ((parser.flags & 1) === 0 && parser.token === 86106) {
|
|
5784
5821
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
|
|
5785
5822
|
if (scope) {
|
|
5786
5823
|
key = declaration.id ? declaration.id.name : '';
|
|
@@ -5937,7 +5974,7 @@ function parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, isPatt
|
|
|
5937
5974
|
const { token } = parser;
|
|
5938
5975
|
const expr = parseIdentifier(parser, context, isPattern);
|
|
5939
5976
|
const { flags } = parser;
|
|
5940
|
-
if ((flags & 1)
|
|
5977
|
+
if ((flags & 1) === 0) {
|
|
5941
5978
|
if (parser.token === 86106) {
|
|
5942
5979
|
return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
|
|
5943
5980
|
}
|
|
@@ -5971,7 +6008,7 @@ function parseYieldExpression(parser, context, inGroup, canAssign, start, line,
|
|
|
5971
6008
|
report(parser, 120);
|
|
5972
6009
|
let argument = null;
|
|
5973
6010
|
let delegate = false;
|
|
5974
|
-
if ((parser.flags & 1)
|
|
6011
|
+
if ((parser.flags & 1) === 0) {
|
|
5975
6012
|
delegate = consumeOpt(parser, context | 32768, 8457014);
|
|
5976
6013
|
if (parser.token & (12288 | 65536) || delegate) {
|
|
5977
6014
|
argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
@@ -6048,8 +6085,8 @@ function parseFunctionBody(parser, context, scope, origin, firstRestricted, scop
|
|
|
6048
6085
|
if (context & 64 &&
|
|
6049
6086
|
scope &&
|
|
6050
6087
|
scopeError !== void 0 &&
|
|
6051
|
-
(prevContext & 1024)
|
|
6052
|
-
(context & 8192)
|
|
6088
|
+
(prevContext & 1024) === 0 &&
|
|
6089
|
+
(context & 8192) === 0) {
|
|
6053
6090
|
reportScopeError(scopeError);
|
|
6054
6091
|
}
|
|
6055
6092
|
}
|
|
@@ -6075,19 +6112,19 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
6075
6112
|
case 67108991:
|
|
6076
6113
|
report(parser, 161);
|
|
6077
6114
|
case 67174411: {
|
|
6078
|
-
if ((context & 524288)
|
|
6115
|
+
if ((context & 524288) === 0)
|
|
6079
6116
|
report(parser, 26);
|
|
6080
6117
|
if (context & 16384)
|
|
6081
|
-
report(parser,
|
|
6118
|
+
report(parser, 27);
|
|
6082
6119
|
parser.assignable = 2;
|
|
6083
6120
|
break;
|
|
6084
6121
|
}
|
|
6085
6122
|
case 69271571:
|
|
6086
6123
|
case 67108877: {
|
|
6087
|
-
if ((context & 262144)
|
|
6124
|
+
if ((context & 262144) === 0)
|
|
6088
6125
|
report(parser, 27);
|
|
6089
6126
|
if (context & 16384)
|
|
6090
|
-
report(parser,
|
|
6127
|
+
report(parser, 27);
|
|
6091
6128
|
parser.assignable = 1;
|
|
6092
6129
|
break;
|
|
6093
6130
|
}
|
|
@@ -6114,14 +6151,14 @@ function parseUpdateExpression(parser, context, expr, start, line, column) {
|
|
|
6114
6151
|
});
|
|
6115
6152
|
}
|
|
6116
6153
|
function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain, start, line, column) {
|
|
6117
|
-
if ((parser.token & 33619968) === 33619968 && (parser.flags & 1)
|
|
6154
|
+
if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) === 0) {
|
|
6118
6155
|
expr = parseUpdateExpression(parser, context, expr, start, line, column);
|
|
6119
6156
|
}
|
|
6120
6157
|
else if ((parser.token & 67108864) === 67108864) {
|
|
6121
|
-
context = (context | 134217728
|
|
6158
|
+
context = (context | 134217728) ^ 134217728;
|
|
6122
6159
|
switch (parser.token) {
|
|
6123
6160
|
case 67108877: {
|
|
6124
|
-
nextToken(parser, context | 1073741824);
|
|
6161
|
+
nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
|
|
6125
6162
|
parser.assignable = 1;
|
|
6126
6163
|
const property = parsePropertyOrPrivatePropertyName(parser, context);
|
|
6127
6164
|
expr = finishNode(parser, context, start, line, column, {
|
|
@@ -6177,7 +6214,7 @@ function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain,
|
|
|
6177
6214
|
break;
|
|
6178
6215
|
}
|
|
6179
6216
|
case 67108991: {
|
|
6180
|
-
nextToken(parser, context);
|
|
6217
|
+
nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
|
|
6181
6218
|
parser.flags |= 2048;
|
|
6182
6219
|
parser.assignable = 2;
|
|
6183
6220
|
expr = parseOptionalChain(parser, context, expr, start, line, column);
|
|
@@ -6241,7 +6278,7 @@ function parseOptionalChain(parser, context, expr, start, line, column) {
|
|
|
6241
6278
|
});
|
|
6242
6279
|
}
|
|
6243
6280
|
else {
|
|
6244
|
-
if ((parser.token & (143360 | 4096))
|
|
6281
|
+
if ((parser.token & (143360 | 4096)) === 0)
|
|
6245
6282
|
report(parser, 154);
|
|
6246
6283
|
const property = parseIdentifier(parser, context, 0);
|
|
6247
6284
|
parser.assignable = 2;
|
|
@@ -6259,7 +6296,7 @@ function parseOptionalChain(parser, context, expr, start, line, column) {
|
|
|
6259
6296
|
return node;
|
|
6260
6297
|
}
|
|
6261
6298
|
function parsePropertyOrPrivatePropertyName(parser, context) {
|
|
6262
|
-
if ((parser.token & (143360 | 4096))
|
|
6299
|
+
if ((parser.token & (143360 | 4096)) === 0 && parser.token !== 131) {
|
|
6263
6300
|
report(parser, 154);
|
|
6264
6301
|
}
|
|
6265
6302
|
return context & 1 && parser.token === 131
|
|
@@ -6584,11 +6621,11 @@ function parseFunctionDeclaration(parser, context, scope, origin, allowGen, flag
|
|
|
6584
6621
|
let firstRestricted;
|
|
6585
6622
|
let functionScope = scope ? createScope() : void 0;
|
|
6586
6623
|
if (parser.token === 67174411) {
|
|
6587
|
-
if ((flags & 1)
|
|
6624
|
+
if ((flags & 1) === 0)
|
|
6588
6625
|
report(parser, 37, 'Function');
|
|
6589
6626
|
}
|
|
6590
6627
|
else {
|
|
6591
|
-
const kind = origin & 4 && ((context & 8192)
|
|
6628
|
+
const kind = origin & 4 && ((context & 8192) === 0 || (context & 2048) === 0)
|
|
6592
6629
|
? 4
|
|
6593
6630
|
: 64;
|
|
6594
6631
|
validateFunctionName(parser, context | ((context & 3072) << 11), parser.token);
|
|
@@ -6734,7 +6771,7 @@ function parseArrayExpressionOrPattern(parser, context, scope, skipInitializer,
|
|
|
6734
6771
|
destructible |=
|
|
6735
6772
|
kind & 1
|
|
6736
6773
|
? 32
|
|
6737
|
-
: (kind & 2)
|
|
6774
|
+
: (kind & 2) === 0
|
|
6738
6775
|
? 16
|
|
6739
6776
|
: 0;
|
|
6740
6777
|
left = parseMemberOrUpdateExpression(parser, context, left, inGroup, 0, tokenPos, linePos, colPos);
|
|
@@ -6793,7 +6830,7 @@ function parseArrayExpressionOrPattern(parser, context, scope, skipInitializer,
|
|
|
6793
6830
|
left = parseLeftHandSideExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
|
|
6794
6831
|
if (parser.token !== 18 && parser.token !== 20) {
|
|
6795
6832
|
left = parseAssignmentExpression(parser, context, inGroup, isPattern, tokenPos, linePos, colPos, left);
|
|
6796
|
-
if ((kind & (2 | 1))
|
|
6833
|
+
if ((kind & (2 | 1)) === 0 && token === 67174411)
|
|
6797
6834
|
destructible |= 16;
|
|
6798
6835
|
}
|
|
6799
6836
|
else if (parser.assignable & 2) {
|
|
@@ -6982,7 +7019,7 @@ function parseSpreadOrRestElement(parser, context, scope, closingToken, kind, or
|
|
|
6982
7019
|
});
|
|
6983
7020
|
}
|
|
6984
7021
|
function parseMethodDefinition(parser, context, kind, inGroup, start, line, column) {
|
|
6985
|
-
const modifierFlags = (kind & 64)
|
|
7022
|
+
const modifierFlags = (kind & 64) === 0 ? 31981568 : 14680064;
|
|
6986
7023
|
context =
|
|
6987
7024
|
((context | modifierFlags) ^ modifierFlags) |
|
|
6988
7025
|
((kind & 88) << 18) |
|
|
@@ -7550,7 +7587,7 @@ function parseMethodFormals(parser, context, scope, kind, type, inGroup) {
|
|
|
7550
7587
|
let left = null;
|
|
7551
7588
|
const { tokenPos, linePos, colPos } = parser;
|
|
7552
7589
|
if (parser.token & 143360) {
|
|
7553
|
-
if ((context & 1024)
|
|
7590
|
+
if ((context & 1024) === 0) {
|
|
7554
7591
|
if ((parser.token & 36864) === 36864) {
|
|
7555
7592
|
parser.flags |= 256;
|
|
7556
7593
|
}
|
|
@@ -7811,7 +7848,7 @@ function parseArrowFunctionExpression(parser, context, scope, params, isAsync, s
|
|
|
7811
7848
|
(134221824 | 8192 | 16384), scope, 16, void 0, void 0);
|
|
7812
7849
|
switch (parser.token) {
|
|
7813
7850
|
case 69271571:
|
|
7814
|
-
if ((parser.flags & 1)
|
|
7851
|
+
if ((parser.flags & 1) === 0) {
|
|
7815
7852
|
report(parser, 112);
|
|
7816
7853
|
}
|
|
7817
7854
|
break;
|
|
@@ -7820,13 +7857,13 @@ function parseArrowFunctionExpression(parser, context, scope, params, isAsync, s
|
|
|
7820
7857
|
case 22:
|
|
7821
7858
|
report(parser, 113);
|
|
7822
7859
|
case 67174411:
|
|
7823
|
-
if ((parser.flags & 1)
|
|
7860
|
+
if ((parser.flags & 1) === 0) {
|
|
7824
7861
|
report(parser, 112);
|
|
7825
7862
|
}
|
|
7826
7863
|
parser.flags |= 1024;
|
|
7827
7864
|
break;
|
|
7828
7865
|
}
|
|
7829
|
-
if ((parser.token & 8454144) === 8454144 && (parser.flags & 1)
|
|
7866
|
+
if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) === 0)
|
|
7830
7867
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
7831
7868
|
if ((parser.token & 33619968) === 33619968)
|
|
7832
7869
|
report(parser, 121);
|
|
@@ -7852,7 +7889,7 @@ function parseFormalParametersOrFormalList(parser, context, scope, inGroup, kind
|
|
|
7852
7889
|
let left;
|
|
7853
7890
|
const { tokenPos, linePos, colPos } = parser;
|
|
7854
7891
|
if (parser.token & 143360) {
|
|
7855
|
-
if ((context & 1024)
|
|
7892
|
+
if ((context & 1024) === 0) {
|
|
7856
7893
|
if ((parser.token & 36864) === 36864) {
|
|
7857
7894
|
parser.flags |= 256;
|
|
7858
7895
|
}
|
|
@@ -8172,7 +8209,7 @@ function parseClassDeclaration(parser, context, scope, flags, start, line, colum
|
|
|
8172
8209
|
id = parseIdentifier(parser, context, 0);
|
|
8173
8210
|
}
|
|
8174
8211
|
else {
|
|
8175
|
-
if ((flags & 1)
|
|
8212
|
+
if ((flags & 1) === 0)
|
|
8176
8213
|
report(parser, 37, 'Class');
|
|
8177
8214
|
}
|
|
8178
8215
|
let inheritedContext = context;
|
|
@@ -8303,7 +8340,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8303
8340
|
}
|
|
8304
8341
|
break;
|
|
8305
8342
|
case 209007:
|
|
8306
|
-
if (parser.token !== 67174411 && (parser.flags & 1)
|
|
8343
|
+
if (parser.token !== 67174411 && (parser.flags & 1) === 0) {
|
|
8307
8344
|
if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8308
8345
|
return parsePropertyDefinition(parser, context, key, kind, decorators, tokenPos, linePos, colPos);
|
|
8309
8346
|
}
|
|
@@ -8341,12 +8378,13 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8341
8378
|
}
|
|
8342
8379
|
else if (context & 1 && parser.token === 131) {
|
|
8343
8380
|
kind |= 4096;
|
|
8344
|
-
key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
|
|
8345
|
-
context = context | 16384;
|
|
8381
|
+
key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
|
|
8346
8382
|
}
|
|
8347
8383
|
else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8348
8384
|
kind |= 128;
|
|
8349
|
-
|
|
8385
|
+
}
|
|
8386
|
+
else if (isStatic && token === 2162700) {
|
|
8387
|
+
return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
|
|
8350
8388
|
}
|
|
8351
8389
|
else if (token === 122) {
|
|
8352
8390
|
key = parseIdentifier(parser, context, 0);
|
|
@@ -8377,16 +8415,16 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8377
8415
|
else
|
|
8378
8416
|
report(parser, 131);
|
|
8379
8417
|
}
|
|
8380
|
-
if ((kind & 2)
|
|
8418
|
+
if ((kind & 2) === 0) {
|
|
8381
8419
|
if (parser.tokenValue === 'constructor') {
|
|
8382
8420
|
if ((parser.token & 1073741824) === 1073741824) {
|
|
8383
8421
|
report(parser, 125);
|
|
8384
8422
|
}
|
|
8385
|
-
else if ((kind & 32)
|
|
8423
|
+
else if ((kind & 32) === 0 && parser.token === 67174411) {
|
|
8386
8424
|
if (kind & (768 | 16 | 128 | 8)) {
|
|
8387
8425
|
report(parser, 50, 'accessor');
|
|
8388
8426
|
}
|
|
8389
|
-
else if ((context & 524288)
|
|
8427
|
+
else if ((context & 524288) === 0) {
|
|
8390
8428
|
if (parser.flags & 32)
|
|
8391
8429
|
report(parser, 51);
|
|
8392
8430
|
else
|
|
@@ -8395,7 +8433,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8395
8433
|
}
|
|
8396
8434
|
kind |= 64;
|
|
8397
8435
|
}
|
|
8398
|
-
else if ((kind & 4096)
|
|
8436
|
+
else if ((kind & 4096) === 0 &&
|
|
8399
8437
|
kind & (32 | 768 | 8 | 16) &&
|
|
8400
8438
|
parser.tokenValue === 'prototype') {
|
|
8401
8439
|
report(parser, 49);
|
|
@@ -8408,7 +8446,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8408
8446
|
return finishNode(parser, context, start, line, column, context & 1
|
|
8409
8447
|
? {
|
|
8410
8448
|
type: 'MethodDefinition',
|
|
8411
|
-
kind: (kind & 32)
|
|
8449
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8412
8450
|
? 'constructor'
|
|
8413
8451
|
: kind & 256
|
|
8414
8452
|
? 'get'
|
|
@@ -8423,7 +8461,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8423
8461
|
}
|
|
8424
8462
|
: {
|
|
8425
8463
|
type: 'MethodDefinition',
|
|
8426
|
-
kind: (kind & 32)
|
|
8464
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8427
8465
|
? 'constructor'
|
|
8428
8466
|
: kind & 256
|
|
8429
8467
|
? 'get'
|
|
@@ -8712,7 +8750,7 @@ function parseJSXNamespacedName(parser, context, namespace, start, line, column)
|
|
|
8712
8750
|
});
|
|
8713
8751
|
}
|
|
8714
8752
|
function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
|
|
8715
|
-
nextToken(parser, context);
|
|
8753
|
+
nextToken(parser, context | 32768);
|
|
8716
8754
|
const { tokenPos, linePos, colPos } = parser;
|
|
8717
8755
|
if (parser.token === 14)
|
|
8718
8756
|
return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
|
|
@@ -8766,7 +8804,7 @@ var estree = /*#__PURE__*/Object.freeze({
|
|
|
8766
8804
|
__proto__: null
|
|
8767
8805
|
});
|
|
8768
8806
|
|
|
8769
|
-
var version$1 = "4.
|
|
8807
|
+
var version$1 = "4.3.1";
|
|
8770
8808
|
|
|
8771
8809
|
const version = version$1;
|
|
8772
8810
|
function parseScript(source, options) {
|