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.umd.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.meriyah = {}));
|
|
5
|
-
}(this, (function (exports) { 'use strict';
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const errorMessages = {
|
|
8
8
|
[0]: 'Unexpected token',
|
|
@@ -869,7 +869,7 @@
|
|
|
869
869
|
break;
|
|
870
870
|
case 117:
|
|
871
871
|
if (mask & 16)
|
|
872
|
-
report(parser, 34, '
|
|
872
|
+
report(parser, 34, 'u');
|
|
873
873
|
mask |= 16;
|
|
874
874
|
break;
|
|
875
875
|
case 121:
|
|
@@ -878,9 +878,14 @@
|
|
|
878
878
|
mask |= 8;
|
|
879
879
|
break;
|
|
880
880
|
case 115:
|
|
881
|
-
if (mask &
|
|
881
|
+
if (mask & 32)
|
|
882
882
|
report(parser, 34, 's');
|
|
883
|
-
mask |=
|
|
883
|
+
mask |= 32;
|
|
884
|
+
break;
|
|
885
|
+
case 100:
|
|
886
|
+
if (mask & 64)
|
|
887
|
+
report(parser, 34, 'd');
|
|
888
|
+
mask |= 64;
|
|
884
889
|
break;
|
|
885
890
|
default:
|
|
886
891
|
report(parser, 33);
|
|
@@ -900,7 +905,13 @@
|
|
|
900
905
|
return new RegExp(pattern, flags);
|
|
901
906
|
}
|
|
902
907
|
catch (e) {
|
|
903
|
-
|
|
908
|
+
try {
|
|
909
|
+
new RegExp(pattern, flags.replace('d', ''));
|
|
910
|
+
return null;
|
|
911
|
+
}
|
|
912
|
+
catch (e) {
|
|
913
|
+
report(parser, 32);
|
|
914
|
+
}
|
|
904
915
|
}
|
|
905
916
|
}
|
|
906
917
|
|
|
@@ -1211,8 +1222,8 @@
|
|
|
1211
1222
|
digits++;
|
|
1212
1223
|
char = advanceChar(parser);
|
|
1213
1224
|
}
|
|
1214
|
-
if (digits
|
|
1215
|
-
report(parser, digits
|
|
1225
|
+
if (digits === 0 || !allowSeparator) {
|
|
1226
|
+
report(parser, digits === 0 ? 19 : 147);
|
|
1216
1227
|
}
|
|
1217
1228
|
}
|
|
1218
1229
|
else if ((char | 32) === 111) {
|
|
@@ -1232,8 +1243,8 @@
|
|
|
1232
1243
|
digits++;
|
|
1233
1244
|
char = advanceChar(parser);
|
|
1234
1245
|
}
|
|
1235
|
-
if (digits
|
|
1236
|
-
report(parser, digits
|
|
1246
|
+
if (digits === 0 || !allowSeparator) {
|
|
1247
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1237
1248
|
}
|
|
1238
1249
|
}
|
|
1239
1250
|
else if ((char | 32) === 98) {
|
|
@@ -1253,8 +1264,8 @@
|
|
|
1253
1264
|
digits++;
|
|
1254
1265
|
char = advanceChar(parser);
|
|
1255
1266
|
}
|
|
1256
|
-
if (digits
|
|
1257
|
-
report(parser, digits
|
|
1267
|
+
if (digits === 0 || !allowSeparator) {
|
|
1268
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1258
1269
|
}
|
|
1259
1270
|
}
|
|
1260
1271
|
else if (CharTypes[char] & 32) {
|
|
@@ -1330,7 +1341,7 @@
|
|
|
1330
1341
|
if (CharTypes[char] & 256)
|
|
1331
1342
|
char = advanceChar(parser);
|
|
1332
1343
|
const { index } = parser;
|
|
1333
|
-
if ((CharTypes[char] & 16)
|
|
1344
|
+
if ((CharTypes[char] & 16) === 0)
|
|
1334
1345
|
report(parser, 10);
|
|
1335
1346
|
value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
|
|
1336
1347
|
char = parser.currentChar;
|
|
@@ -1504,14 +1515,28 @@
|
|
|
1504
1515
|
return 208897;
|
|
1505
1516
|
if (!hasEscape)
|
|
1506
1517
|
return token;
|
|
1518
|
+
if (token === 209008) {
|
|
1519
|
+
if ((context & (2048 | 4194304)) === 0) {
|
|
1520
|
+
return token;
|
|
1521
|
+
}
|
|
1522
|
+
return 121;
|
|
1523
|
+
}
|
|
1507
1524
|
if (context & 1024) {
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1525
|
+
if (token === 36972) {
|
|
1526
|
+
return 122;
|
|
1527
|
+
}
|
|
1528
|
+
if ((token & 36864) === 36864) {
|
|
1529
|
+
return 122;
|
|
1530
|
+
}
|
|
1531
|
+
if ((token & 20480) === 20480) {
|
|
1532
|
+
if (context & 1073741824 && (context & 8192) === 0) {
|
|
1533
|
+
return token;
|
|
1534
|
+
}
|
|
1535
|
+
else {
|
|
1536
|
+
return 121;
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
return 143483;
|
|
1515
1540
|
}
|
|
1516
1541
|
if (context & 1073741824 &&
|
|
1517
1542
|
(context & 8192) === 0 &&
|
|
@@ -1524,13 +1549,13 @@
|
|
|
1524
1549
|
? 121
|
|
1525
1550
|
: token;
|
|
1526
1551
|
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1552
|
+
if (token === 209007) {
|
|
1553
|
+
return 143483;
|
|
1554
|
+
}
|
|
1555
|
+
if ((token & 36864) === 36864) {
|
|
1556
|
+
return token;
|
|
1557
|
+
}
|
|
1558
|
+
return 121;
|
|
1534
1559
|
}
|
|
1535
1560
|
return 208897;
|
|
1536
1561
|
}
|
|
@@ -1793,7 +1818,7 @@
|
|
|
1793
1818
|
}
|
|
1794
1819
|
else if (ch === 61) {
|
|
1795
1820
|
advanceChar(parser);
|
|
1796
|
-
return
|
|
1821
|
+
return 8456256;
|
|
1797
1822
|
}
|
|
1798
1823
|
if (ch === 33) {
|
|
1799
1824
|
const index = parser.index + 1;
|
|
@@ -1811,7 +1836,7 @@
|
|
|
1811
1836
|
return 8456258;
|
|
1812
1837
|
}
|
|
1813
1838
|
if (ch === 47) {
|
|
1814
|
-
if ((context & 16)
|
|
1839
|
+
if ((context & 16) === 0)
|
|
1815
1840
|
return 8456258;
|
|
1816
1841
|
const index = parser.index + 1;
|
|
1817
1842
|
if (index < parser.end) {
|
|
@@ -1976,7 +2001,7 @@
|
|
|
1976
2001
|
const ch = parser.currentChar;
|
|
1977
2002
|
if (ch === 61) {
|
|
1978
2003
|
advanceChar(parser);
|
|
1979
|
-
return
|
|
2004
|
+
return 8456257;
|
|
1980
2005
|
}
|
|
1981
2006
|
if (ch !== 62)
|
|
1982
2007
|
return 8456259;
|
|
@@ -4917,7 +4942,7 @@
|
|
|
4917
4942
|
case 86106:
|
|
4918
4943
|
report(parser, context & 1024
|
|
4919
4944
|
? 73
|
|
4920
|
-
: (context & 256)
|
|
4945
|
+
: (context & 256) === 0
|
|
4921
4946
|
? 75
|
|
4922
4947
|
: 74);
|
|
4923
4948
|
case 86096:
|
|
@@ -4963,12 +4988,12 @@
|
|
|
4963
4988
|
});
|
|
4964
4989
|
}
|
|
4965
4990
|
function parseReturnStatement(parser, context, start, line, column) {
|
|
4966
|
-
if ((context & 32)
|
|
4991
|
+
if ((context & 32) === 0 && context & 8192)
|
|
4967
4992
|
report(parser, 89);
|
|
4968
4993
|
nextToken(parser, context | 32768);
|
|
4969
4994
|
const argument = parser.flags & 1 || parser.token & 1048576
|
|
4970
4995
|
? null
|
|
4971
|
-
: parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.
|
|
4996
|
+
: parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
|
|
4972
4997
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
4973
4998
|
return finishNode(parser, context, start, line, column, {
|
|
4974
4999
|
type: 'ReturnStatement',
|
|
@@ -4987,7 +5012,7 @@
|
|
|
4987
5012
|
validateAndDeclareLabel(parser, labels, value);
|
|
4988
5013
|
nextToken(parser, context | 32768);
|
|
4989
5014
|
const body = allowFuncDecl &&
|
|
4990
|
-
(context & 1024)
|
|
5015
|
+
(context & 1024) === 0 &&
|
|
4991
5016
|
context & 256 &&
|
|
4992
5017
|
parser.token === 86106
|
|
4993
5018
|
? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
@@ -5096,7 +5121,7 @@
|
|
|
5096
5121
|
}
|
|
5097
5122
|
function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
|
|
5098
5123
|
return context & 1024 ||
|
|
5099
|
-
(context & 256)
|
|
5124
|
+
(context & 256) === 0 ||
|
|
5100
5125
|
parser.token !== 86106
|
|
5101
5126
|
? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
5102
5127
|
: parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
|
|
@@ -5161,11 +5186,11 @@
|
|
|
5161
5186
|
return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5162
5187
|
}
|
|
5163
5188
|
function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
5164
|
-
if ((context & 131072)
|
|
5189
|
+
if ((context & 131072) === 0)
|
|
5165
5190
|
report(parser, 65);
|
|
5166
5191
|
nextToken(parser, context);
|
|
5167
5192
|
let label = null;
|
|
5168
|
-
if ((parser.flags & 1)
|
|
5193
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5169
5194
|
const { tokenValue } = parser;
|
|
5170
5195
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5171
5196
|
if (!isValidLabel(parser, labels, tokenValue, 1))
|
|
@@ -5180,13 +5205,13 @@
|
|
|
5180
5205
|
function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
5181
5206
|
nextToken(parser, context | 32768);
|
|
5182
5207
|
let label = null;
|
|
5183
|
-
if ((parser.flags & 1)
|
|
5208
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5184
5209
|
const { tokenValue } = parser;
|
|
5185
5210
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5186
5211
|
if (!isValidLabel(parser, labels, tokenValue, 0))
|
|
5187
5212
|
report(parser, 134, tokenValue);
|
|
5188
5213
|
}
|
|
5189
|
-
else if ((context & (4096 | 131072))
|
|
5214
|
+
else if ((context & (4096 | 131072)) === 0) {
|
|
5190
5215
|
report(parser, 66);
|
|
5191
5216
|
}
|
|
5192
5217
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
@@ -5266,6 +5291,17 @@
|
|
|
5266
5291
|
body
|
|
5267
5292
|
});
|
|
5268
5293
|
}
|
|
5294
|
+
function parseStaticBlock(parser, context, scope, start, line, column) {
|
|
5295
|
+
if (scope)
|
|
5296
|
+
scope = addChildScope(scope, 2);
|
|
5297
|
+
const ctorContext = 16384 | 524288;
|
|
5298
|
+
context = ((context | ctorContext) ^ ctorContext) | 262144;
|
|
5299
|
+
const { body } = parseBlock(parser, context, scope, {}, start, line, column);
|
|
5300
|
+
return finishNode(parser, context, start, line, column, {
|
|
5301
|
+
type: 'StaticBlock',
|
|
5302
|
+
body
|
|
5303
|
+
});
|
|
5304
|
+
}
|
|
5269
5305
|
function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
|
|
5270
5306
|
nextToken(parser, context | 32768);
|
|
5271
5307
|
const body = parseIterationStatementBody(parser, context, scope, labels);
|
|
@@ -5353,10 +5389,10 @@
|
|
|
5353
5389
|
if (parser.token === 1077936157) {
|
|
5354
5390
|
nextToken(parser, context | 32768);
|
|
5355
5391
|
init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5356
|
-
if (origin & 32 || (token & 2097152)
|
|
5392
|
+
if (origin & 32 || (token & 2097152) === 0) {
|
|
5357
5393
|
if (parser.token === 274549 ||
|
|
5358
5394
|
(parser.token === 8738868 &&
|
|
5359
|
-
(token & 2097152 || (kind & 4)
|
|
5395
|
+
(token & 2097152 || (kind & 4) === 0 || context & 1024))) {
|
|
5360
5396
|
reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
|
|
5361
5397
|
}
|
|
5362
5398
|
}
|
|
@@ -5373,7 +5409,8 @@
|
|
|
5373
5409
|
}
|
|
5374
5410
|
function parseForStatement(parser, context, scope, labels, start, line, column) {
|
|
5375
5411
|
nextToken(parser, context);
|
|
5376
|
-
const forAwait = (context & 4194304) > 0 &&
|
|
5412
|
+
const forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
|
|
5413
|
+
consumeOpt(parser, context, 209008);
|
|
5377
5414
|
consume(parser, context | 32768, 67174411);
|
|
5378
5415
|
if (scope)
|
|
5379
5416
|
scope = addChildScope(scope, 1);
|
|
@@ -5662,7 +5699,7 @@
|
|
|
5662
5699
|
const { tokenPos, linePos, colPos } = parser;
|
|
5663
5700
|
declaration = parseIdentifier(parser, context, 0);
|
|
5664
5701
|
const { flags } = parser;
|
|
5665
|
-
if ((flags & 1)
|
|
5702
|
+
if ((flags & 1) === 0) {
|
|
5666
5703
|
if (parser.token === 86106) {
|
|
5667
5704
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
|
|
5668
5705
|
}
|
|
@@ -5786,7 +5823,7 @@
|
|
|
5786
5823
|
case 209007:
|
|
5787
5824
|
const { tokenPos, linePos, colPos } = parser;
|
|
5788
5825
|
nextToken(parser, context);
|
|
5789
|
-
if ((parser.flags & 1)
|
|
5826
|
+
if ((parser.flags & 1) === 0 && parser.token === 86106) {
|
|
5790
5827
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
|
|
5791
5828
|
if (scope) {
|
|
5792
5829
|
key = declaration.id ? declaration.id.name : '';
|
|
@@ -5943,7 +5980,7 @@
|
|
|
5943
5980
|
const { token } = parser;
|
|
5944
5981
|
const expr = parseIdentifier(parser, context, isPattern);
|
|
5945
5982
|
const { flags } = parser;
|
|
5946
|
-
if ((flags & 1)
|
|
5983
|
+
if ((flags & 1) === 0) {
|
|
5947
5984
|
if (parser.token === 86106) {
|
|
5948
5985
|
return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
|
|
5949
5986
|
}
|
|
@@ -5977,7 +6014,7 @@
|
|
|
5977
6014
|
report(parser, 120);
|
|
5978
6015
|
let argument = null;
|
|
5979
6016
|
let delegate = false;
|
|
5980
|
-
if ((parser.flags & 1)
|
|
6017
|
+
if ((parser.flags & 1) === 0) {
|
|
5981
6018
|
delegate = consumeOpt(parser, context | 32768, 8457014);
|
|
5982
6019
|
if (parser.token & (12288 | 65536) || delegate) {
|
|
5983
6020
|
argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
@@ -6054,8 +6091,8 @@
|
|
|
6054
6091
|
if (context & 64 &&
|
|
6055
6092
|
scope &&
|
|
6056
6093
|
scopeError !== void 0 &&
|
|
6057
|
-
(prevContext & 1024)
|
|
6058
|
-
(context & 8192)
|
|
6094
|
+
(prevContext & 1024) === 0 &&
|
|
6095
|
+
(context & 8192) === 0) {
|
|
6059
6096
|
reportScopeError(scopeError);
|
|
6060
6097
|
}
|
|
6061
6098
|
}
|
|
@@ -6081,19 +6118,19 @@
|
|
|
6081
6118
|
case 67108991:
|
|
6082
6119
|
report(parser, 161);
|
|
6083
6120
|
case 67174411: {
|
|
6084
|
-
if ((context & 524288)
|
|
6121
|
+
if ((context & 524288) === 0)
|
|
6085
6122
|
report(parser, 26);
|
|
6086
6123
|
if (context & 16384)
|
|
6087
|
-
report(parser,
|
|
6124
|
+
report(parser, 27);
|
|
6088
6125
|
parser.assignable = 2;
|
|
6089
6126
|
break;
|
|
6090
6127
|
}
|
|
6091
6128
|
case 69271571:
|
|
6092
6129
|
case 67108877: {
|
|
6093
|
-
if ((context & 262144)
|
|
6130
|
+
if ((context & 262144) === 0)
|
|
6094
6131
|
report(parser, 27);
|
|
6095
6132
|
if (context & 16384)
|
|
6096
|
-
report(parser,
|
|
6133
|
+
report(parser, 27);
|
|
6097
6134
|
parser.assignable = 1;
|
|
6098
6135
|
break;
|
|
6099
6136
|
}
|
|
@@ -6120,14 +6157,14 @@
|
|
|
6120
6157
|
});
|
|
6121
6158
|
}
|
|
6122
6159
|
function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain, start, line, column) {
|
|
6123
|
-
if ((parser.token & 33619968) === 33619968 && (parser.flags & 1)
|
|
6160
|
+
if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) === 0) {
|
|
6124
6161
|
expr = parseUpdateExpression(parser, context, expr, start, line, column);
|
|
6125
6162
|
}
|
|
6126
6163
|
else if ((parser.token & 67108864) === 67108864) {
|
|
6127
|
-
context = (context | 134217728
|
|
6164
|
+
context = (context | 134217728) ^ 134217728;
|
|
6128
6165
|
switch (parser.token) {
|
|
6129
6166
|
case 67108877: {
|
|
6130
|
-
nextToken(parser, context | 1073741824);
|
|
6167
|
+
nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
|
|
6131
6168
|
parser.assignable = 1;
|
|
6132
6169
|
const property = parsePropertyOrPrivatePropertyName(parser, context);
|
|
6133
6170
|
expr = finishNode(parser, context, start, line, column, {
|
|
@@ -6183,7 +6220,7 @@
|
|
|
6183
6220
|
break;
|
|
6184
6221
|
}
|
|
6185
6222
|
case 67108991: {
|
|
6186
|
-
nextToken(parser, context);
|
|
6223
|
+
nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
|
|
6187
6224
|
parser.flags |= 2048;
|
|
6188
6225
|
parser.assignable = 2;
|
|
6189
6226
|
expr = parseOptionalChain(parser, context, expr, start, line, column);
|
|
@@ -6247,7 +6284,7 @@
|
|
|
6247
6284
|
});
|
|
6248
6285
|
}
|
|
6249
6286
|
else {
|
|
6250
|
-
if ((parser.token & (143360 | 4096))
|
|
6287
|
+
if ((parser.token & (143360 | 4096)) === 0)
|
|
6251
6288
|
report(parser, 154);
|
|
6252
6289
|
const property = parseIdentifier(parser, context, 0);
|
|
6253
6290
|
parser.assignable = 2;
|
|
@@ -6265,7 +6302,7 @@
|
|
|
6265
6302
|
return node;
|
|
6266
6303
|
}
|
|
6267
6304
|
function parsePropertyOrPrivatePropertyName(parser, context) {
|
|
6268
|
-
if ((parser.token & (143360 | 4096))
|
|
6305
|
+
if ((parser.token & (143360 | 4096)) === 0 && parser.token !== 131) {
|
|
6269
6306
|
report(parser, 154);
|
|
6270
6307
|
}
|
|
6271
6308
|
return context & 1 && parser.token === 131
|
|
@@ -6590,11 +6627,11 @@
|
|
|
6590
6627
|
let firstRestricted;
|
|
6591
6628
|
let functionScope = scope ? createScope() : void 0;
|
|
6592
6629
|
if (parser.token === 67174411) {
|
|
6593
|
-
if ((flags & 1)
|
|
6630
|
+
if ((flags & 1) === 0)
|
|
6594
6631
|
report(parser, 37, 'Function');
|
|
6595
6632
|
}
|
|
6596
6633
|
else {
|
|
6597
|
-
const kind = origin & 4 && ((context & 8192)
|
|
6634
|
+
const kind = origin & 4 && ((context & 8192) === 0 || (context & 2048) === 0)
|
|
6598
6635
|
? 4
|
|
6599
6636
|
: 64;
|
|
6600
6637
|
validateFunctionName(parser, context | ((context & 3072) << 11), parser.token);
|
|
@@ -6740,7 +6777,7 @@
|
|
|
6740
6777
|
destructible |=
|
|
6741
6778
|
kind & 1
|
|
6742
6779
|
? 32
|
|
6743
|
-
: (kind & 2)
|
|
6780
|
+
: (kind & 2) === 0
|
|
6744
6781
|
? 16
|
|
6745
6782
|
: 0;
|
|
6746
6783
|
left = parseMemberOrUpdateExpression(parser, context, left, inGroup, 0, tokenPos, linePos, colPos);
|
|
@@ -6799,7 +6836,7 @@
|
|
|
6799
6836
|
left = parseLeftHandSideExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
|
|
6800
6837
|
if (parser.token !== 18 && parser.token !== 20) {
|
|
6801
6838
|
left = parseAssignmentExpression(parser, context, inGroup, isPattern, tokenPos, linePos, colPos, left);
|
|
6802
|
-
if ((kind & (2 | 1))
|
|
6839
|
+
if ((kind & (2 | 1)) === 0 && token === 67174411)
|
|
6803
6840
|
destructible |= 16;
|
|
6804
6841
|
}
|
|
6805
6842
|
else if (parser.assignable & 2) {
|
|
@@ -6988,7 +7025,7 @@
|
|
|
6988
7025
|
});
|
|
6989
7026
|
}
|
|
6990
7027
|
function parseMethodDefinition(parser, context, kind, inGroup, start, line, column) {
|
|
6991
|
-
const modifierFlags = (kind & 64)
|
|
7028
|
+
const modifierFlags = (kind & 64) === 0 ? 31981568 : 14680064;
|
|
6992
7029
|
context =
|
|
6993
7030
|
((context | modifierFlags) ^ modifierFlags) |
|
|
6994
7031
|
((kind & 88) << 18) |
|
|
@@ -7556,7 +7593,7 @@
|
|
|
7556
7593
|
let left = null;
|
|
7557
7594
|
const { tokenPos, linePos, colPos } = parser;
|
|
7558
7595
|
if (parser.token & 143360) {
|
|
7559
|
-
if ((context & 1024)
|
|
7596
|
+
if ((context & 1024) === 0) {
|
|
7560
7597
|
if ((parser.token & 36864) === 36864) {
|
|
7561
7598
|
parser.flags |= 256;
|
|
7562
7599
|
}
|
|
@@ -7817,7 +7854,7 @@
|
|
|
7817
7854
|
(134221824 | 8192 | 16384), scope, 16, void 0, void 0);
|
|
7818
7855
|
switch (parser.token) {
|
|
7819
7856
|
case 69271571:
|
|
7820
|
-
if ((parser.flags & 1)
|
|
7857
|
+
if ((parser.flags & 1) === 0) {
|
|
7821
7858
|
report(parser, 112);
|
|
7822
7859
|
}
|
|
7823
7860
|
break;
|
|
@@ -7826,13 +7863,13 @@
|
|
|
7826
7863
|
case 22:
|
|
7827
7864
|
report(parser, 113);
|
|
7828
7865
|
case 67174411:
|
|
7829
|
-
if ((parser.flags & 1)
|
|
7866
|
+
if ((parser.flags & 1) === 0) {
|
|
7830
7867
|
report(parser, 112);
|
|
7831
7868
|
}
|
|
7832
7869
|
parser.flags |= 1024;
|
|
7833
7870
|
break;
|
|
7834
7871
|
}
|
|
7835
|
-
if ((parser.token & 8454144) === 8454144 && (parser.flags & 1)
|
|
7872
|
+
if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) === 0)
|
|
7836
7873
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
7837
7874
|
if ((parser.token & 33619968) === 33619968)
|
|
7838
7875
|
report(parser, 121);
|
|
@@ -7858,7 +7895,7 @@
|
|
|
7858
7895
|
let left;
|
|
7859
7896
|
const { tokenPos, linePos, colPos } = parser;
|
|
7860
7897
|
if (parser.token & 143360) {
|
|
7861
|
-
if ((context & 1024)
|
|
7898
|
+
if ((context & 1024) === 0) {
|
|
7862
7899
|
if ((parser.token & 36864) === 36864) {
|
|
7863
7900
|
parser.flags |= 256;
|
|
7864
7901
|
}
|
|
@@ -8178,7 +8215,7 @@
|
|
|
8178
8215
|
id = parseIdentifier(parser, context, 0);
|
|
8179
8216
|
}
|
|
8180
8217
|
else {
|
|
8181
|
-
if ((flags & 1)
|
|
8218
|
+
if ((flags & 1) === 0)
|
|
8182
8219
|
report(parser, 37, 'Class');
|
|
8183
8220
|
}
|
|
8184
8221
|
let inheritedContext = context;
|
|
@@ -8309,7 +8346,7 @@
|
|
|
8309
8346
|
}
|
|
8310
8347
|
break;
|
|
8311
8348
|
case 209007:
|
|
8312
|
-
if (parser.token !== 67174411 && (parser.flags & 1)
|
|
8349
|
+
if (parser.token !== 67174411 && (parser.flags & 1) === 0) {
|
|
8313
8350
|
if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8314
8351
|
return parsePropertyDefinition(parser, context, key, kind, decorators, tokenPos, linePos, colPos);
|
|
8315
8352
|
}
|
|
@@ -8347,12 +8384,13 @@
|
|
|
8347
8384
|
}
|
|
8348
8385
|
else if (context & 1 && parser.token === 131) {
|
|
8349
8386
|
kind |= 4096;
|
|
8350
|
-
key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
|
|
8351
|
-
context = context | 16384;
|
|
8387
|
+
key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
|
|
8352
8388
|
}
|
|
8353
8389
|
else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8354
8390
|
kind |= 128;
|
|
8355
|
-
|
|
8391
|
+
}
|
|
8392
|
+
else if (isStatic && token === 2162700) {
|
|
8393
|
+
return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
|
|
8356
8394
|
}
|
|
8357
8395
|
else if (token === 122) {
|
|
8358
8396
|
key = parseIdentifier(parser, context, 0);
|
|
@@ -8383,16 +8421,16 @@
|
|
|
8383
8421
|
else
|
|
8384
8422
|
report(parser, 131);
|
|
8385
8423
|
}
|
|
8386
|
-
if ((kind & 2)
|
|
8424
|
+
if ((kind & 2) === 0) {
|
|
8387
8425
|
if (parser.tokenValue === 'constructor') {
|
|
8388
8426
|
if ((parser.token & 1073741824) === 1073741824) {
|
|
8389
8427
|
report(parser, 125);
|
|
8390
8428
|
}
|
|
8391
|
-
else if ((kind & 32)
|
|
8429
|
+
else if ((kind & 32) === 0 && parser.token === 67174411) {
|
|
8392
8430
|
if (kind & (768 | 16 | 128 | 8)) {
|
|
8393
8431
|
report(parser, 50, 'accessor');
|
|
8394
8432
|
}
|
|
8395
|
-
else if ((context & 524288)
|
|
8433
|
+
else if ((context & 524288) === 0) {
|
|
8396
8434
|
if (parser.flags & 32)
|
|
8397
8435
|
report(parser, 51);
|
|
8398
8436
|
else
|
|
@@ -8401,7 +8439,7 @@
|
|
|
8401
8439
|
}
|
|
8402
8440
|
kind |= 64;
|
|
8403
8441
|
}
|
|
8404
|
-
else if ((kind & 4096)
|
|
8442
|
+
else if ((kind & 4096) === 0 &&
|
|
8405
8443
|
kind & (32 | 768 | 8 | 16) &&
|
|
8406
8444
|
parser.tokenValue === 'prototype') {
|
|
8407
8445
|
report(parser, 49);
|
|
@@ -8414,7 +8452,7 @@
|
|
|
8414
8452
|
return finishNode(parser, context, start, line, column, context & 1
|
|
8415
8453
|
? {
|
|
8416
8454
|
type: 'MethodDefinition',
|
|
8417
|
-
kind: (kind & 32)
|
|
8455
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8418
8456
|
? 'constructor'
|
|
8419
8457
|
: kind & 256
|
|
8420
8458
|
? 'get'
|
|
@@ -8429,7 +8467,7 @@
|
|
|
8429
8467
|
}
|
|
8430
8468
|
: {
|
|
8431
8469
|
type: 'MethodDefinition',
|
|
8432
|
-
kind: (kind & 32)
|
|
8470
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8433
8471
|
? 'constructor'
|
|
8434
8472
|
: kind & 256
|
|
8435
8473
|
? 'get'
|
|
@@ -8718,7 +8756,7 @@
|
|
|
8718
8756
|
});
|
|
8719
8757
|
}
|
|
8720
8758
|
function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
|
|
8721
|
-
nextToken(parser, context);
|
|
8759
|
+
nextToken(parser, context | 32768);
|
|
8722
8760
|
const { tokenPos, linePos, colPos } = parser;
|
|
8723
8761
|
if (parser.token === 14)
|
|
8724
8762
|
return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
|
|
@@ -8772,7 +8810,7 @@
|
|
|
8772
8810
|
__proto__: null
|
|
8773
8811
|
});
|
|
8774
8812
|
|
|
8775
|
-
var version$1 = "4.
|
|
8813
|
+
var version$1 = "4.3.1";
|
|
8776
8814
|
|
|
8777
8815
|
const version = version$1;
|
|
8778
8816
|
function parseScript(source, options) {
|
|
@@ -8793,4 +8831,4 @@
|
|
|
8793
8831
|
|
|
8794
8832
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8795
8833
|
|
|
8796
|
-
}))
|
|
8834
|
+
}));
|