meriyah 4.2.1 → 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 +17 -0
- package/dist/meriyah.amd.js +77 -51
- package/dist/meriyah.amd.min.js +1 -1
- package/dist/meriyah.cjs +77 -51
- package/dist/meriyah.cjs.js +77 -51
- package/dist/meriyah.cjs.min.js +1 -1
- package/dist/meriyah.esm.js +77 -51
- 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 +77 -51
- package/dist/meriyah.iife.min.js +1 -1
- package/dist/meriyah.min.cjs +1 -1
- package/dist/meriyah.system.js +77 -51
- package/dist/meriyah.system.min.js +1 -1
- package/dist/meriyah.umd.cjs +77 -51
- package/dist/meriyah.umd.es5.js +88 -58
- package/dist/meriyah.umd.es5.min.js +1 -15
- package/dist/meriyah.umd.js +77 -51
- 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/regexp.d.ts.map +1 -1
- package/dist/src/parser.d.ts +1 -0
- package/dist/src/parser.d.ts.map +1 -1
- package/package.json +25 -30
- 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 +81 -42
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:
|
|
@@ -876,6 +876,11 @@ function scanRegularExpression(parser, context) {
|
|
|
876
876
|
report(parser, 34, 's');
|
|
877
877
|
mask |= 32;
|
|
878
878
|
break;
|
|
879
|
+
case 100:
|
|
880
|
+
if (mask & 64)
|
|
881
|
+
report(parser, 34, 'd');
|
|
882
|
+
mask |= 64;
|
|
883
|
+
break;
|
|
879
884
|
default:
|
|
880
885
|
report(parser, 33);
|
|
881
886
|
}
|
|
@@ -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;
|
|
@@ -1805,7 +1816,7 @@ function scanSingleToken(parser, context, state) {
|
|
|
1805
1816
|
return 8456258;
|
|
1806
1817
|
}
|
|
1807
1818
|
if (ch === 47) {
|
|
1808
|
-
if ((context & 16)
|
|
1819
|
+
if ((context & 16) === 0)
|
|
1809
1820
|
return 8456258;
|
|
1810
1821
|
const index = parser.index + 1;
|
|
1811
1822
|
if (index < parser.end) {
|
|
@@ -4911,7 +4922,7 @@ function parseStatement(parser, context, scope, origin, labels, allowFuncDecl, s
|
|
|
4911
4922
|
case 86106:
|
|
4912
4923
|
report(parser, context & 1024
|
|
4913
4924
|
? 73
|
|
4914
|
-
: (context & 256)
|
|
4925
|
+
: (context & 256) === 0
|
|
4915
4926
|
? 75
|
|
4916
4927
|
: 74);
|
|
4917
4928
|
case 86096:
|
|
@@ -4957,7 +4968,7 @@ function parseBlock(parser, context, scope, labels, start, line, column) {
|
|
|
4957
4968
|
});
|
|
4958
4969
|
}
|
|
4959
4970
|
function parseReturnStatement(parser, context, start, line, column) {
|
|
4960
|
-
if ((context & 32)
|
|
4971
|
+
if ((context & 32) === 0 && context & 8192)
|
|
4961
4972
|
report(parser, 89);
|
|
4962
4973
|
nextToken(parser, context | 32768);
|
|
4963
4974
|
const argument = parser.flags & 1 || parser.token & 1048576
|
|
@@ -4981,7 +4992,7 @@ function parseLabelledStatement(parser, context, scope, origin, labels, value, e
|
|
|
4981
4992
|
validateAndDeclareLabel(parser, labels, value);
|
|
4982
4993
|
nextToken(parser, context | 32768);
|
|
4983
4994
|
const body = allowFuncDecl &&
|
|
4984
|
-
(context & 1024)
|
|
4995
|
+
(context & 1024) === 0 &&
|
|
4985
4996
|
context & 256 &&
|
|
4986
4997
|
parser.token === 86106
|
|
4987
4998
|
? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
@@ -5090,7 +5101,7 @@ function parseIfStatement(parser, context, scope, labels, start, line, column) {
|
|
|
5090
5101
|
}
|
|
5091
5102
|
function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
|
|
5092
5103
|
return context & 1024 ||
|
|
5093
|
-
(context & 256)
|
|
5104
|
+
(context & 256) === 0 ||
|
|
5094
5105
|
parser.token !== 86106
|
|
5095
5106
|
? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
5096
5107
|
: parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
|
|
@@ -5155,11 +5166,11 @@ function parseIterationStatementBody(parser, context, scope, labels) {
|
|
|
5155
5166
|
return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5156
5167
|
}
|
|
5157
5168
|
function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
5158
|
-
if ((context & 131072)
|
|
5169
|
+
if ((context & 131072) === 0)
|
|
5159
5170
|
report(parser, 65);
|
|
5160
5171
|
nextToken(parser, context);
|
|
5161
5172
|
let label = null;
|
|
5162
|
-
if ((parser.flags & 1)
|
|
5173
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5163
5174
|
const { tokenValue } = parser;
|
|
5164
5175
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5165
5176
|
if (!isValidLabel(parser, labels, tokenValue, 1))
|
|
@@ -5174,13 +5185,13 @@ function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
|
5174
5185
|
function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
5175
5186
|
nextToken(parser, context | 32768);
|
|
5176
5187
|
let label = null;
|
|
5177
|
-
if ((parser.flags & 1)
|
|
5188
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5178
5189
|
const { tokenValue } = parser;
|
|
5179
5190
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5180
5191
|
if (!isValidLabel(parser, labels, tokenValue, 0))
|
|
5181
5192
|
report(parser, 134, tokenValue);
|
|
5182
5193
|
}
|
|
5183
|
-
else if ((context & (4096 | 131072))
|
|
5194
|
+
else if ((context & (4096 | 131072)) === 0) {
|
|
5184
5195
|
report(parser, 66);
|
|
5185
5196
|
}
|
|
5186
5197
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
@@ -5260,6 +5271,17 @@ function parseCatchBlock(parser, context, scope, labels, start, line, column) {
|
|
|
5260
5271
|
body
|
|
5261
5272
|
});
|
|
5262
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
|
+
}
|
|
5263
5285
|
function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
|
|
5264
5286
|
nextToken(parser, context | 32768);
|
|
5265
5287
|
const body = parseIterationStatementBody(parser, context, scope, labels);
|
|
@@ -5347,10 +5369,10 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
|
|
|
5347
5369
|
if (parser.token === 1077936157) {
|
|
5348
5370
|
nextToken(parser, context | 32768);
|
|
5349
5371
|
init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5350
|
-
if (origin & 32 || (token & 2097152)
|
|
5372
|
+
if (origin & 32 || (token & 2097152) === 0) {
|
|
5351
5373
|
if (parser.token === 274549 ||
|
|
5352
5374
|
(parser.token === 8738868 &&
|
|
5353
|
-
(token & 2097152 || (kind & 4)
|
|
5375
|
+
(token & 2097152 || (kind & 4) === 0 || context & 1024))) {
|
|
5354
5376
|
reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
|
|
5355
5377
|
}
|
|
5356
5378
|
}
|
|
@@ -5367,7 +5389,8 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
|
|
|
5367
5389
|
}
|
|
5368
5390
|
function parseForStatement(parser, context, scope, labels, start, line, column) {
|
|
5369
5391
|
nextToken(parser, context);
|
|
5370
|
-
const forAwait = (context & 4194304) > 0 &&
|
|
5392
|
+
const forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
|
|
5393
|
+
consumeOpt(parser, context, 209008);
|
|
5371
5394
|
consume(parser, context | 32768, 67174411);
|
|
5372
5395
|
if (scope)
|
|
5373
5396
|
scope = addChildScope(scope, 1);
|
|
@@ -5656,7 +5679,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5656
5679
|
const { tokenPos, linePos, colPos } = parser;
|
|
5657
5680
|
declaration = parseIdentifier(parser, context, 0);
|
|
5658
5681
|
const { flags } = parser;
|
|
5659
|
-
if ((flags & 1)
|
|
5682
|
+
if ((flags & 1) === 0) {
|
|
5660
5683
|
if (parser.token === 86106) {
|
|
5661
5684
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
|
|
5662
5685
|
}
|
|
@@ -5780,7 +5803,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5780
5803
|
case 209007:
|
|
5781
5804
|
const { tokenPos, linePos, colPos } = parser;
|
|
5782
5805
|
nextToken(parser, context);
|
|
5783
|
-
if ((parser.flags & 1)
|
|
5806
|
+
if ((parser.flags & 1) === 0 && parser.token === 86106) {
|
|
5784
5807
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
|
|
5785
5808
|
if (scope) {
|
|
5786
5809
|
key = declaration.id ? declaration.id.name : '';
|
|
@@ -5937,7 +5960,7 @@ function parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, isPatt
|
|
|
5937
5960
|
const { token } = parser;
|
|
5938
5961
|
const expr = parseIdentifier(parser, context, isPattern);
|
|
5939
5962
|
const { flags } = parser;
|
|
5940
|
-
if ((flags & 1)
|
|
5963
|
+
if ((flags & 1) === 0) {
|
|
5941
5964
|
if (parser.token === 86106) {
|
|
5942
5965
|
return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
|
|
5943
5966
|
}
|
|
@@ -5971,7 +5994,7 @@ function parseYieldExpression(parser, context, inGroup, canAssign, start, line,
|
|
|
5971
5994
|
report(parser, 120);
|
|
5972
5995
|
let argument = null;
|
|
5973
5996
|
let delegate = false;
|
|
5974
|
-
if ((parser.flags & 1)
|
|
5997
|
+
if ((parser.flags & 1) === 0) {
|
|
5975
5998
|
delegate = consumeOpt(parser, context | 32768, 8457014);
|
|
5976
5999
|
if (parser.token & (12288 | 65536) || delegate) {
|
|
5977
6000
|
argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
@@ -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,7 +6098,7 @@ 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
6104
|
report(parser, 27);
|
|
@@ -6084,7 +6107,7 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
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
6113
|
report(parser, 27);
|
|
@@ -6114,7 +6137,7 @@ 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) {
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -8346,6 +8369,9 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8346
8369
|
else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8347
8370
|
kind |= 128;
|
|
8348
8371
|
}
|
|
8372
|
+
else if (isStatic && token === 2162700) {
|
|
8373
|
+
return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
|
|
8374
|
+
}
|
|
8349
8375
|
else if (token === 122) {
|
|
8350
8376
|
key = parseIdentifier(parser, context, 0);
|
|
8351
8377
|
if (parser.token !== 67174411)
|
|
@@ -8375,16 +8401,16 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8375
8401
|
else
|
|
8376
8402
|
report(parser, 131);
|
|
8377
8403
|
}
|
|
8378
|
-
if ((kind & 2)
|
|
8404
|
+
if ((kind & 2) === 0) {
|
|
8379
8405
|
if (parser.tokenValue === 'constructor') {
|
|
8380
8406
|
if ((parser.token & 1073741824) === 1073741824) {
|
|
8381
8407
|
report(parser, 125);
|
|
8382
8408
|
}
|
|
8383
|
-
else if ((kind & 32)
|
|
8409
|
+
else if ((kind & 32) === 0 && parser.token === 67174411) {
|
|
8384
8410
|
if (kind & (768 | 16 | 128 | 8)) {
|
|
8385
8411
|
report(parser, 50, 'accessor');
|
|
8386
8412
|
}
|
|
8387
|
-
else if ((context & 524288)
|
|
8413
|
+
else if ((context & 524288) === 0) {
|
|
8388
8414
|
if (parser.flags & 32)
|
|
8389
8415
|
report(parser, 51);
|
|
8390
8416
|
else
|
|
@@ -8393,7 +8419,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8393
8419
|
}
|
|
8394
8420
|
kind |= 64;
|
|
8395
8421
|
}
|
|
8396
|
-
else if ((kind & 4096)
|
|
8422
|
+
else if ((kind & 4096) === 0 &&
|
|
8397
8423
|
kind & (32 | 768 | 8 | 16) &&
|
|
8398
8424
|
parser.tokenValue === 'prototype') {
|
|
8399
8425
|
report(parser, 49);
|
|
@@ -8406,7 +8432,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8406
8432
|
return finishNode(parser, context, start, line, column, context & 1
|
|
8407
8433
|
? {
|
|
8408
8434
|
type: 'MethodDefinition',
|
|
8409
|
-
kind: (kind & 32)
|
|
8435
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8410
8436
|
? 'constructor'
|
|
8411
8437
|
: kind & 256
|
|
8412
8438
|
? 'get'
|
|
@@ -8421,7 +8447,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8421
8447
|
}
|
|
8422
8448
|
: {
|
|
8423
8449
|
type: 'MethodDefinition',
|
|
8424
|
-
kind: (kind & 32)
|
|
8450
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8425
8451
|
? 'constructor'
|
|
8426
8452
|
: kind & 256
|
|
8427
8453
|
? 'get'
|
|
@@ -8764,7 +8790,7 @@ var estree = /*#__PURE__*/Object.freeze({
|
|
|
8764
8790
|
__proto__: null
|
|
8765
8791
|
});
|
|
8766
8792
|
|
|
8767
|
-
var version$1 = "4.
|
|
8793
|
+
var version$1 = "4.3.0";
|
|
8768
8794
|
|
|
8769
8795
|
const version = version$1;
|
|
8770
8796
|
function parseScript(source, options) {
|