meriyah 4.4.2 → 4.4.4
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 +13 -0
- package/README.md +1 -7
- package/dist/meriyah.amd.js +121 -118
- package/dist/meriyah.amd.min.js +1 -1
- package/dist/meriyah.cjs +121 -118
- package/dist/meriyah.cjs.js +121 -118
- package/dist/meriyah.cjs.min.js +1 -1
- package/dist/meriyah.esm.js +121 -118
- package/dist/meriyah.esm.min.js +1 -1
- package/dist/meriyah.esm.min.mjs +1 -1
- package/dist/meriyah.esm.mjs +121 -118
- package/dist/meriyah.iife.js +121 -118
- package/dist/meriyah.iife.min.js +1 -1
- package/dist/meriyah.min.cjs +1 -1
- package/dist/meriyah.system.js +121 -118
- package/dist/meriyah.system.min.js +1 -1
- package/dist/meriyah.umd.cjs +121 -118
- package/dist/meriyah.umd.es5.js +121 -118
- package/dist/meriyah.umd.es5.min.js +1 -1
- package/dist/meriyah.umd.js +121 -118
- package/dist/meriyah.umd.min.cjs +1 -1
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/src/common.d.ts +3 -5
- package/dist/src/common.d.ts.map +1 -1
- package/dist/src/parser.d.ts +4 -6
- package/dist/src/parser.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +4 -7
- package/src/parser.ts +115 -144
package/dist/meriyah.cjs
CHANGED
|
@@ -1528,7 +1528,7 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
|
|
|
1528
1528
|
return 122;
|
|
1529
1529
|
}
|
|
1530
1530
|
if ((token & 20480) === 20480) {
|
|
1531
|
-
if (context &
|
|
1531
|
+
if (context & 268435456 && (context & 8192) === 0) {
|
|
1532
1532
|
return token;
|
|
1533
1533
|
}
|
|
1534
1534
|
else {
|
|
@@ -1537,12 +1537,12 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
|
|
|
1537
1537
|
}
|
|
1538
1538
|
return 143483;
|
|
1539
1539
|
}
|
|
1540
|
-
if (context &
|
|
1540
|
+
if (context & 268435456 &&
|
|
1541
1541
|
(context & 8192) === 0 &&
|
|
1542
1542
|
(token & 20480) === 20480)
|
|
1543
1543
|
return token;
|
|
1544
1544
|
if (token === 241773) {
|
|
1545
|
-
return context &
|
|
1545
|
+
return context & 268435456
|
|
1546
1546
|
? 143483
|
|
1547
1547
|
: context & 2097152
|
|
1548
1548
|
? 121
|
|
@@ -4361,10 +4361,9 @@ function scanJSXIdentifier(parser) {
|
|
|
4361
4361
|
return parser.token;
|
|
4362
4362
|
}
|
|
4363
4363
|
|
|
4364
|
-
function matchOrInsertSemicolon(parser, context
|
|
4364
|
+
function matchOrInsertSemicolon(parser, context) {
|
|
4365
4365
|
if ((parser.flags & 1) === 0 &&
|
|
4366
|
-
(parser.token & 1048576) !== 1048576
|
|
4367
|
-
!specDeviation) {
|
|
4366
|
+
(parser.token & 1048576) !== 1048576) {
|
|
4368
4367
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
4369
4368
|
}
|
|
4370
4369
|
if (!consumeOpt(parser, context, 1074790417)) {
|
|
@@ -4756,7 +4755,7 @@ function parseSource(source, options, context) {
|
|
|
4756
4755
|
if (options.ranges)
|
|
4757
4756
|
context |= 2;
|
|
4758
4757
|
if (options.uniqueKeyInPattern)
|
|
4759
|
-
context |=
|
|
4758
|
+
context |= 536870912;
|
|
4760
4759
|
if (options.lexical)
|
|
4761
4760
|
context |= 64;
|
|
4762
4761
|
if (options.webcompat)
|
|
@@ -4773,10 +4772,6 @@ function parseSource(source, options, context) {
|
|
|
4773
4772
|
context |= 1024;
|
|
4774
4773
|
if (options.jsx)
|
|
4775
4774
|
context |= 16;
|
|
4776
|
-
if (options.identifierPattern)
|
|
4777
|
-
context |= 268435456;
|
|
4778
|
-
if (options.specDeviation)
|
|
4779
|
-
context |= 536870912;
|
|
4780
4775
|
if (options.source)
|
|
4781
4776
|
sourceFile = options.source;
|
|
4782
4777
|
if (options.onComment != null) {
|
|
@@ -4828,7 +4823,7 @@ function parseSource(source, options, context) {
|
|
|
4828
4823
|
return node;
|
|
4829
4824
|
}
|
|
4830
4825
|
function parseStatementList(parser, context, scope) {
|
|
4831
|
-
nextToken(parser, context | 32768 |
|
|
4826
|
+
nextToken(parser, context | 32768 | 268435456);
|
|
4832
4827
|
const statements = [];
|
|
4833
4828
|
while (parser.token === 134283267) {
|
|
4834
4829
|
const { index, tokenPos, tokenValue, linePos, colPos, token } = parser;
|
|
@@ -4961,14 +4956,14 @@ function parseExpressionOrLabelledStatement(parser, context, scope, origin, labe
|
|
|
4961
4956
|
let expr;
|
|
4962
4957
|
switch (token) {
|
|
4963
4958
|
case 241739:
|
|
4964
|
-
expr = parseIdentifier(parser, context
|
|
4959
|
+
expr = parseIdentifier(parser, context);
|
|
4965
4960
|
if (context & 1024)
|
|
4966
4961
|
report(parser, 83);
|
|
4967
4962
|
if (parser.token === 69271571)
|
|
4968
4963
|
report(parser, 82);
|
|
4969
4964
|
break;
|
|
4970
4965
|
default:
|
|
4971
|
-
expr = parsePrimaryExpression(parser, context, 2, 0, 1, 0,
|
|
4966
|
+
expr = parsePrimaryExpression(parser, context, 2, 0, 1, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
|
|
4972
4967
|
}
|
|
4973
4968
|
if (token & 143360 && parser.token === 21) {
|
|
4974
4969
|
return parseLabelledStatement(parser, context, scope, origin, labels, tokenValue, expr, token, allowFuncDecl, start, line, column);
|
|
@@ -5030,7 +5025,7 @@ function parseLabelledStatement(parser, context, scope, origin, labels, value, e
|
|
|
5030
5025
|
}
|
|
5031
5026
|
function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, origin, labels, allowFuncDecl, start, line, column) {
|
|
5032
5027
|
const { token, tokenValue } = parser;
|
|
5033
|
-
let expr = parseIdentifier(parser, context
|
|
5028
|
+
let expr = parseIdentifier(parser, context);
|
|
5034
5029
|
if (parser.token === 21) {
|
|
5035
5030
|
return parseLabelledStatement(parser, context, scope, origin, labels, tokenValue, expr, token, 1, start, line, column);
|
|
5036
5031
|
}
|
|
@@ -5198,7 +5193,7 @@ function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
|
5198
5193
|
let label = null;
|
|
5199
5194
|
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5200
5195
|
const { tokenValue } = parser;
|
|
5201
|
-
label = parseIdentifier(parser, context | 32768
|
|
5196
|
+
label = parseIdentifier(parser, context | 32768);
|
|
5202
5197
|
if (!isValidLabel(parser, labels, tokenValue, 1))
|
|
5203
5198
|
report(parser, 135, tokenValue);
|
|
5204
5199
|
}
|
|
@@ -5213,7 +5208,7 @@ function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
|
5213
5208
|
let label = null;
|
|
5214
5209
|
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5215
5210
|
const { tokenValue } = parser;
|
|
5216
|
-
label = parseIdentifier(parser, context | 32768
|
|
5211
|
+
label = parseIdentifier(parser, context | 32768);
|
|
5217
5212
|
if (!isValidLabel(parser, labels, tokenValue, 0))
|
|
5218
5213
|
report(parser, 135, tokenValue);
|
|
5219
5214
|
}
|
|
@@ -5324,7 +5319,7 @@ function parseDoWhileStatement(parser, context, scope, labels, start, line, colu
|
|
|
5324
5319
|
}
|
|
5325
5320
|
function parseLetIdentOrVarDeclarationStatement(parser, context, scope, origin, start, line, column) {
|
|
5326
5321
|
const { token, tokenValue } = parser;
|
|
5327
|
-
let expr = parseIdentifier(parser, context
|
|
5322
|
+
let expr = parseIdentifier(parser, context);
|
|
5328
5323
|
if (parser.token & (143360 | 2097152)) {
|
|
5329
5324
|
const declarations = parseVariableDeclarationList(parser, context, scope, 8, 0);
|
|
5330
5325
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
@@ -5394,7 +5389,7 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
|
|
|
5394
5389
|
const id = parseBindingPattern(parser, context, scope, kind, origin, tokenPos, linePos, colPos);
|
|
5395
5390
|
if (parser.token === 1077936157) {
|
|
5396
5391
|
nextToken(parser, context | 32768);
|
|
5397
|
-
init = parseExpression(parser, context, 1, 0,
|
|
5392
|
+
init = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5398
5393
|
if (origin & 32 || (token & 2097152) === 0) {
|
|
5399
5394
|
if (parser.token === 274549 ||
|
|
5400
5395
|
(parser.token === 8738868 &&
|
|
@@ -5429,7 +5424,7 @@ function parseForStatement(parser, context, scope, labels, start, line, column)
|
|
|
5429
5424
|
const { token, tokenPos, linePos, colPos } = parser;
|
|
5430
5425
|
if (isVarDecl) {
|
|
5431
5426
|
if (token === 241739) {
|
|
5432
|
-
init = parseIdentifier(parser, context
|
|
5427
|
+
init = parseIdentifier(parser, context);
|
|
5433
5428
|
if (parser.token & (143360 | 2097152)) {
|
|
5434
5429
|
if (parser.token === 8738868) {
|
|
5435
5430
|
if (context & 1024)
|
|
@@ -5497,7 +5492,7 @@ function parseForStatement(parser, context, scope, labels, start, line, column)
|
|
|
5497
5492
|
report(parser, 78, forAwait ? 'await' : 'of');
|
|
5498
5493
|
reinterpretToPattern(parser, init);
|
|
5499
5494
|
nextToken(parser, context | 32768);
|
|
5500
|
-
right = parseExpression(parser, context, 1, 0,
|
|
5495
|
+
right = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5501
5496
|
consume(parser, context | 32768, 16);
|
|
5502
5497
|
const body = parseIterationStatementBody(parser, context, scope, labels);
|
|
5503
5498
|
return finishNode(parser, context, start, line, column, {
|
|
@@ -5557,7 +5552,7 @@ function parseRestrictedIdentifier(parser, context, scope) {
|
|
|
5557
5552
|
report(parser, 116);
|
|
5558
5553
|
if (scope)
|
|
5559
5554
|
addBlockName(parser, context, scope, parser.tokenValue, 8, 0);
|
|
5560
|
-
return parseIdentifier(parser, context
|
|
5555
|
+
return parseIdentifier(parser, context);
|
|
5561
5556
|
}
|
|
5562
5557
|
function parseImportDeclaration(parser, context, scope) {
|
|
5563
5558
|
const start = parser.tokenPos;
|
|
@@ -5630,7 +5625,9 @@ function parseImportNamespaceSpecifier(parser, context, scope) {
|
|
|
5630
5625
|
});
|
|
5631
5626
|
}
|
|
5632
5627
|
function parseModuleSpecifier(parser, context) {
|
|
5633
|
-
consumeOpt(parser, context, 12404)
|
|
5628
|
+
if (!consumeOpt(parser, context, 12404)) {
|
|
5629
|
+
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
5630
|
+
}
|
|
5634
5631
|
if (parser.token !== 134283267)
|
|
5635
5632
|
report(parser, 103, 'Import');
|
|
5636
5633
|
return parseLiteral(parser, context);
|
|
@@ -5639,7 +5636,7 @@ function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers)
|
|
|
5639
5636
|
nextToken(parser, context);
|
|
5640
5637
|
while (parser.token & 143360) {
|
|
5641
5638
|
let { token, tokenValue, tokenPos, linePos, colPos } = parser;
|
|
5642
|
-
const imported = parseIdentifier(parser, context
|
|
5639
|
+
const imported = parseIdentifier(parser, context);
|
|
5643
5640
|
let local;
|
|
5644
5641
|
if (consumeOpt(parser, context, 77934)) {
|
|
5645
5642
|
if ((parser.token & 134217728) === 134217728 || parser.token === 18) {
|
|
@@ -5649,7 +5646,7 @@ function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers)
|
|
|
5649
5646
|
validateBindingIdentifier(parser, context, 16, parser.token, 0);
|
|
5650
5647
|
}
|
|
5651
5648
|
tokenValue = parser.tokenValue;
|
|
5652
|
-
local = parseIdentifier(parser, context
|
|
5649
|
+
local = parseIdentifier(parser, context);
|
|
5653
5650
|
}
|
|
5654
5651
|
else {
|
|
5655
5652
|
validateBindingIdentifier(parser, context, 16, token, 0);
|
|
@@ -5709,7 +5706,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5709
5706
|
break;
|
|
5710
5707
|
case 209007:
|
|
5711
5708
|
const { tokenPos, linePos, colPos } = parser;
|
|
5712
|
-
declaration = parseIdentifier(parser, context
|
|
5709
|
+
declaration = parseIdentifier(parser, context);
|
|
5713
5710
|
const { flags } = parser;
|
|
5714
5711
|
if ((flags & 1) === 0) {
|
|
5715
5712
|
if (parser.token === 86106) {
|
|
@@ -5724,14 +5721,14 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5724
5721
|
else if (parser.token & 143360) {
|
|
5725
5722
|
if (scope)
|
|
5726
5723
|
scope = createArrowHeadParsingScope(parser, context, parser.tokenValue);
|
|
5727
|
-
declaration = parseIdentifier(parser, context
|
|
5724
|
+
declaration = parseIdentifier(parser, context);
|
|
5728
5725
|
declaration = parseArrowFunctionExpression(parser, context, scope, [declaration], 1, tokenPos, linePos, colPos);
|
|
5729
5726
|
}
|
|
5730
5727
|
}
|
|
5731
5728
|
}
|
|
5732
5729
|
break;
|
|
5733
5730
|
default:
|
|
5734
|
-
declaration = parseExpression(parser, context, 1, 0,
|
|
5731
|
+
declaration = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5735
5732
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
5736
5733
|
}
|
|
5737
5734
|
if (scope)
|
|
@@ -5749,7 +5746,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5749
5746
|
if (isNamedDeclaration) {
|
|
5750
5747
|
if (scope)
|
|
5751
5748
|
declareUnboundVariable(parser, parser.tokenValue);
|
|
5752
|
-
exported = parseIdentifier(parser, context
|
|
5749
|
+
exported = parseIdentifier(parser, context);
|
|
5753
5750
|
}
|
|
5754
5751
|
consume(parser, context, 12404);
|
|
5755
5752
|
if (parser.token !== 134283267)
|
|
@@ -5768,7 +5765,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5768
5765
|
const tmpExportedBindings = [];
|
|
5769
5766
|
while (parser.token & 143360) {
|
|
5770
5767
|
const { tokenPos, tokenValue, linePos, colPos } = parser;
|
|
5771
|
-
const local = parseIdentifier(parser, context
|
|
5768
|
+
const local = parseIdentifier(parser, context);
|
|
5772
5769
|
let exported;
|
|
5773
5770
|
if (parser.token === 77934) {
|
|
5774
5771
|
nextToken(parser, context);
|
|
@@ -5779,7 +5776,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5779
5776
|
tmpExportedNames.push(parser.tokenValue);
|
|
5780
5777
|
tmpExportedBindings.push(tokenValue);
|
|
5781
5778
|
}
|
|
5782
|
-
exported = parseIdentifier(parser, context
|
|
5779
|
+
exported = parseIdentifier(parser, context);
|
|
5783
5780
|
}
|
|
5784
5781
|
else {
|
|
5785
5782
|
if (scope) {
|
|
@@ -5853,15 +5850,15 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5853
5850
|
source
|
|
5854
5851
|
});
|
|
5855
5852
|
}
|
|
5856
|
-
function parseExpression(parser, context, canAssign,
|
|
5857
|
-
let expr = parsePrimaryExpression(parser, context, 2, 0, canAssign,
|
|
5853
|
+
function parseExpression(parser, context, canAssign, inGroup, start, line, column) {
|
|
5854
|
+
let expr = parsePrimaryExpression(parser, context, 2, 0, canAssign, inGroup, 1, start, line, column);
|
|
5858
5855
|
expr = parseMemberOrUpdateExpression(parser, context, expr, inGroup, 0, start, line, column);
|
|
5859
5856
|
return parseAssignmentExpression(parser, context, inGroup, 0, start, line, column, expr);
|
|
5860
5857
|
}
|
|
5861
5858
|
function parseSequenceExpression(parser, context, inGroup, start, line, column, expr) {
|
|
5862
5859
|
const expressions = [expr];
|
|
5863
5860
|
while (consumeOpt(parser, context | 32768, 18)) {
|
|
5864
|
-
expressions.push(parseExpression(parser, context, 1,
|
|
5861
|
+
expressions.push(parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos));
|
|
5865
5862
|
}
|
|
5866
5863
|
return finishNode(parser, context, start, line, column, {
|
|
5867
5864
|
type: 'SequenceExpression',
|
|
@@ -5869,7 +5866,7 @@ function parseSequenceExpression(parser, context, inGroup, start, line, column,
|
|
|
5869
5866
|
});
|
|
5870
5867
|
}
|
|
5871
5868
|
function parseExpressions(parser, context, inGroup, canAssign, start, line, column) {
|
|
5872
|
-
const expr = parseExpression(parser, context, canAssign,
|
|
5869
|
+
const expr = parseExpression(parser, context, canAssign, inGroup, start, line, column);
|
|
5873
5870
|
return parser.token === 18
|
|
5874
5871
|
? parseSequenceExpression(parser, context, inGroup, start, line, column, expr)
|
|
5875
5872
|
: expr;
|
|
@@ -5884,7 +5881,7 @@ function parseAssignmentExpression(parser, context, inGroup, isPattern, start, l
|
|
|
5884
5881
|
reinterpretToPattern(parser, left);
|
|
5885
5882
|
}
|
|
5886
5883
|
nextToken(parser, context | 32768);
|
|
5887
|
-
const right = parseExpression(parser, context, 1,
|
|
5884
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5888
5885
|
parser.assignable = 2;
|
|
5889
5886
|
return finishNode(parser, context, start, line, column, isPattern
|
|
5890
5887
|
? {
|
|
@@ -5910,7 +5907,7 @@ function parseAssignmentExpression(parser, context, inGroup, isPattern, start, l
|
|
|
5910
5907
|
function parseAssignmentExpressionOrPattern(parser, context, inGroup, isPattern, start, line, column, left) {
|
|
5911
5908
|
const { token } = parser;
|
|
5912
5909
|
nextToken(parser, context | 32768);
|
|
5913
|
-
const right = parseExpression(parser, context, 1,
|
|
5910
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5914
5911
|
left = finishNode(parser, context, start, line, column, isPattern
|
|
5915
5912
|
? {
|
|
5916
5913
|
type: 'AssignmentPattern',
|
|
@@ -5927,10 +5924,10 @@ function parseAssignmentExpressionOrPattern(parser, context, inGroup, isPattern,
|
|
|
5927
5924
|
return left;
|
|
5928
5925
|
}
|
|
5929
5926
|
function parseConditionalExpression(parser, context, test, start, line, column) {
|
|
5930
|
-
const consequent = parseExpression(parser, (context | 134217728) ^ 134217728, 1, 0,
|
|
5927
|
+
const consequent = parseExpression(parser, (context | 134217728) ^ 134217728, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5931
5928
|
consume(parser, context | 32768, 21);
|
|
5932
5929
|
parser.assignable = 1;
|
|
5933
|
-
const alternate = parseExpression(parser, context, 1, 0,
|
|
5930
|
+
const alternate = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5934
5931
|
parser.assignable = 2;
|
|
5935
5932
|
return finishNode(parser, context, start, line, column, {
|
|
5936
5933
|
type: 'ConditionalExpression',
|
|
@@ -5988,9 +5985,9 @@ function parseUnaryExpression(parser, context, isLHS, start, line, column, inGro
|
|
|
5988
5985
|
prefix: true
|
|
5989
5986
|
});
|
|
5990
5987
|
}
|
|
5991
|
-
function parseAsyncExpression(parser, context, inGroup, isLHS, canAssign,
|
|
5988
|
+
function parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, inNew, start, line, column) {
|
|
5992
5989
|
const { token } = parser;
|
|
5993
|
-
const expr = parseIdentifier(parser, context
|
|
5990
|
+
const expr = parseIdentifier(parser, context);
|
|
5994
5991
|
const { flags } = parser;
|
|
5995
5992
|
if ((flags & 1) === 0) {
|
|
5996
5993
|
if (parser.token === 86106) {
|
|
@@ -6030,7 +6027,7 @@ function parseYieldExpression(parser, context, inGroup, canAssign, start, line,
|
|
|
6030
6027
|
if ((parser.flags & 1) === 0) {
|
|
6031
6028
|
delegate = consumeOpt(parser, context | 32768, 8457014);
|
|
6032
6029
|
if (parser.token & (12288 | 65536) || delegate) {
|
|
6033
|
-
argument = parseExpression(parser, context, 1, 0,
|
|
6030
|
+
argument = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6034
6031
|
}
|
|
6035
6032
|
}
|
|
6036
6033
|
parser.assignable = 2;
|
|
@@ -6133,8 +6130,9 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
6133
6130
|
case 67174411: {
|
|
6134
6131
|
if ((context & 524288) === 0)
|
|
6135
6132
|
report(parser, 26);
|
|
6136
|
-
if (context & 16384)
|
|
6133
|
+
if (context & 16384 && !(context & 33554432)) {
|
|
6137
6134
|
report(parser, 27);
|
|
6135
|
+
}
|
|
6138
6136
|
parser.assignable = 2;
|
|
6139
6137
|
break;
|
|
6140
6138
|
}
|
|
@@ -6142,8 +6140,9 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
6142
6140
|
case 67108877: {
|
|
6143
6141
|
if ((context & 262144) === 0)
|
|
6144
6142
|
report(parser, 27);
|
|
6145
|
-
if (context & 16384)
|
|
6143
|
+
if (context & 16384 && !(context & 33554432)) {
|
|
6146
6144
|
report(parser, 27);
|
|
6145
|
+
}
|
|
6147
6146
|
parser.assignable = 1;
|
|
6148
6147
|
break;
|
|
6149
6148
|
}
|
|
@@ -6153,7 +6152,7 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
6153
6152
|
return finishNode(parser, context, start, line, column, { type: 'Super' });
|
|
6154
6153
|
}
|
|
6155
6154
|
function parseLeftHandSideExpression(parser, context, canAssign, inGroup, isLHS, start, line, column) {
|
|
6156
|
-
const expression = parsePrimaryExpression(parser, context, 2, 0, canAssign,
|
|
6155
|
+
const expression = parsePrimaryExpression(parser, context, 2, 0, canAssign, inGroup, isLHS, start, line, column);
|
|
6157
6156
|
return parseMemberOrUpdateExpression(parser, context, expression, inGroup, 0, start, line, column);
|
|
6158
6157
|
}
|
|
6159
6158
|
function parseUpdateExpression(parser, context, expr, start, line, column) {
|
|
@@ -6177,7 +6176,10 @@ function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain,
|
|
|
6177
6176
|
context = (context | 134217728) ^ 134217728;
|
|
6178
6177
|
switch (parser.token) {
|
|
6179
6178
|
case 67108877: {
|
|
6180
|
-
nextToken(parser, (context |
|
|
6179
|
+
nextToken(parser, (context | 268435456 | 8192) ^ 8192);
|
|
6180
|
+
if (context & 16384 && parser.token === 131 && parser.tokenValue === 'super') {
|
|
6181
|
+
report(parser, 27);
|
|
6182
|
+
}
|
|
6181
6183
|
parser.assignable = 1;
|
|
6182
6184
|
const property = parsePropertyOrPrivatePropertyName(parser, context | 65536);
|
|
6183
6185
|
expr = finishNode(parser, context, start, line, column, {
|
|
@@ -6233,7 +6235,7 @@ function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain,
|
|
|
6233
6235
|
break;
|
|
6234
6236
|
}
|
|
6235
6237
|
case 67108991: {
|
|
6236
|
-
nextToken(parser, (context |
|
|
6238
|
+
nextToken(parser, (context | 268435456 | 8192) ^ 8192);
|
|
6237
6239
|
parser.flags |= 2048;
|
|
6238
6240
|
parser.assignable = 2;
|
|
6239
6241
|
expr = parseOptionalChain(parser, context, expr, start, line, column);
|
|
@@ -6299,7 +6301,7 @@ function parseOptionalChain(parser, context, expr, start, line, column) {
|
|
|
6299
6301
|
else {
|
|
6300
6302
|
if ((parser.token & (143360 | 4096)) === 0)
|
|
6301
6303
|
report(parser, 155);
|
|
6302
|
-
const property = parseIdentifier(parser, context
|
|
6304
|
+
const property = parseIdentifier(parser, context);
|
|
6303
6305
|
parser.assignable = 2;
|
|
6304
6306
|
node = finishNode(parser, context, start, line, column, {
|
|
6305
6307
|
type: 'MemberExpression',
|
|
@@ -6320,7 +6322,7 @@ function parsePropertyOrPrivatePropertyName(parser, context) {
|
|
|
6320
6322
|
}
|
|
6321
6323
|
return context & 1 && parser.token === 131
|
|
6322
6324
|
? parsePrivateIdentifier(parser, context, parser.tokenPos, parser.linePos, parser.colPos)
|
|
6323
|
-
: parseIdentifier(parser, context
|
|
6325
|
+
: parseIdentifier(parser, context);
|
|
6324
6326
|
}
|
|
6325
6327
|
function parseUpdateExpressionPrefixed(parser, context, inNew, isLHS, start, line, column) {
|
|
6326
6328
|
if (inNew)
|
|
@@ -6341,7 +6343,7 @@ function parseUpdateExpressionPrefixed(parser, context, inNew, isLHS, start, lin
|
|
|
6341
6343
|
prefix: true
|
|
6342
6344
|
});
|
|
6343
6345
|
}
|
|
6344
|
-
function parsePrimaryExpression(parser, context, kind, inNew, canAssign,
|
|
6346
|
+
function parsePrimaryExpression(parser, context, kind, inNew, canAssign, inGroup, isLHS, start, line, column) {
|
|
6345
6347
|
if ((parser.token & 143360) === 143360) {
|
|
6346
6348
|
switch (parser.token) {
|
|
6347
6349
|
case 209008:
|
|
@@ -6349,10 +6351,10 @@ function parsePrimaryExpression(parser, context, kind, inNew, canAssign, isPatte
|
|
|
6349
6351
|
case 241773:
|
|
6350
6352
|
return parseYieldExpression(parser, context, inGroup, canAssign, start, line, column);
|
|
6351
6353
|
case 209007:
|
|
6352
|
-
return parseAsyncExpression(parser, context, inGroup, isLHS, canAssign,
|
|
6354
|
+
return parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, inNew, start, line, column);
|
|
6353
6355
|
}
|
|
6354
6356
|
const { token, tokenValue } = parser;
|
|
6355
|
-
const expr = parseIdentifier(parser, context | 65536
|
|
6357
|
+
const expr = parseIdentifier(parser, context | 65536);
|
|
6356
6358
|
if (parser.token === 10) {
|
|
6357
6359
|
if (!isLHS)
|
|
6358
6360
|
report(parser, 0);
|
|
@@ -6431,7 +6433,7 @@ function parsePrimaryExpression(parser, context, kind, inNew, canAssign, isPatte
|
|
|
6431
6433
|
}
|
|
6432
6434
|
}
|
|
6433
6435
|
function parseImportCallOrMetaExpression(parser, context, inNew, inGroup, start, line, column) {
|
|
6434
|
-
let expr = parseIdentifier(parser, context
|
|
6436
|
+
let expr = parseIdentifier(parser, context);
|
|
6435
6437
|
if (parser.token === 67108877) {
|
|
6436
6438
|
return parseImportMetaExpression(parser, context, expr, start, line, column);
|
|
6437
6439
|
}
|
|
@@ -6451,14 +6453,14 @@ function parseImportMetaExpression(parser, context, meta, start, line, column) {
|
|
|
6451
6453
|
return finishNode(parser, context, start, line, column, {
|
|
6452
6454
|
type: 'MetaProperty',
|
|
6453
6455
|
meta,
|
|
6454
|
-
property: parseIdentifier(parser, context
|
|
6456
|
+
property: parseIdentifier(parser, context)
|
|
6455
6457
|
});
|
|
6456
6458
|
}
|
|
6457
6459
|
function parseImportExpression(parser, context, inGroup, start, line, column) {
|
|
6458
6460
|
consume(parser, context | 32768, 67174411);
|
|
6459
6461
|
if (parser.token === 14)
|
|
6460
6462
|
report(parser, 139);
|
|
6461
|
-
const source = parseExpression(parser, context, 1,
|
|
6463
|
+
const source = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6462
6464
|
consume(parser, context, 16);
|
|
6463
6465
|
return finishNode(parser, context, start, line, column, {
|
|
6464
6466
|
type: 'ImportExpression',
|
|
@@ -6547,7 +6549,7 @@ function parseTemplateElement(parser, context, cooked, raw, start, line, col, ta
|
|
|
6547
6549
|
function parseSpreadElement(parser, context, start, line, column) {
|
|
6548
6550
|
context = (context | 134217728) ^ 134217728;
|
|
6549
6551
|
consume(parser, context | 32768, 14);
|
|
6550
|
-
const argument = parseExpression(parser, context, 1, 0,
|
|
6552
|
+
const argument = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6551
6553
|
parser.assignable = 1;
|
|
6552
6554
|
return finishNode(parser, context, start, line, column, {
|
|
6553
6555
|
type: 'SpreadElement',
|
|
@@ -6566,7 +6568,7 @@ function parseArguments(parser, context, inGroup) {
|
|
|
6566
6568
|
args.push(parseSpreadElement(parser, context, parser.tokenPos, parser.linePos, parser.colPos));
|
|
6567
6569
|
}
|
|
6568
6570
|
else {
|
|
6569
|
-
args.push(parseExpression(parser, context, 1,
|
|
6571
|
+
args.push(parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos));
|
|
6570
6572
|
}
|
|
6571
6573
|
if (parser.token !== 18)
|
|
6572
6574
|
break;
|
|
@@ -6577,19 +6579,13 @@ function parseArguments(parser, context, inGroup) {
|
|
|
6577
6579
|
consume(parser, context, 16);
|
|
6578
6580
|
return args;
|
|
6579
6581
|
}
|
|
6580
|
-
function parseIdentifier(parser, context
|
|
6582
|
+
function parseIdentifier(parser, context) {
|
|
6581
6583
|
const { tokenValue, tokenPos, linePos, colPos } = parser;
|
|
6582
6584
|
nextToken(parser, context);
|
|
6583
|
-
return finishNode(parser, context, tokenPos, linePos, colPos,
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
pattern: isPattern === 1
|
|
6588
|
-
}
|
|
6589
|
-
: {
|
|
6590
|
-
type: 'Identifier',
|
|
6591
|
-
name: tokenValue
|
|
6592
|
-
});
|
|
6585
|
+
return finishNode(parser, context, tokenPos, linePos, colPos, {
|
|
6586
|
+
type: 'Identifier',
|
|
6587
|
+
name: tokenValue
|
|
6588
|
+
});
|
|
6593
6589
|
}
|
|
6594
6590
|
function parseLiteral(parser, context) {
|
|
6595
6591
|
const { tokenValue, tokenRaw, tokenPos, linePos, colPos } = parser;
|
|
@@ -6664,7 +6660,7 @@ function parseFunctionDeclaration(parser, context, scope, origin, allowGen, flag
|
|
|
6664
6660
|
}
|
|
6665
6661
|
firstRestricted = parser.token;
|
|
6666
6662
|
if (parser.token & 143360) {
|
|
6667
|
-
id = parseIdentifier(parser, context
|
|
6663
|
+
id = parseIdentifier(parser, context);
|
|
6668
6664
|
}
|
|
6669
6665
|
else {
|
|
6670
6666
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
@@ -6674,7 +6670,7 @@ function parseFunctionDeclaration(parser, context, scope, origin, allowGen, flag
|
|
|
6674
6670
|
((context | 32243712) ^ 32243712) |
|
|
6675
6671
|
67108864 |
|
|
6676
6672
|
((isAsync * 2 + isGenerator) << 21) |
|
|
6677
|
-
(isGenerator ? 0 :
|
|
6673
|
+
(isGenerator ? 0 : 268435456);
|
|
6678
6674
|
if (scope)
|
|
6679
6675
|
functionScope = addChildScope(functionScope, 512);
|
|
6680
6676
|
const params = parseFormalParametersOrFormalList(parser, context | 8388608, functionScope, 0, 1);
|
|
@@ -6701,13 +6697,13 @@ function parseFunctionExpression(parser, context, isAsync, inGroup, start, line,
|
|
|
6701
6697
|
if (scope)
|
|
6702
6698
|
scope = addChildScope(scope, 256);
|
|
6703
6699
|
firstRestricted = parser.token;
|
|
6704
|
-
id = parseIdentifier(parser, context
|
|
6700
|
+
id = parseIdentifier(parser, context);
|
|
6705
6701
|
}
|
|
6706
6702
|
context =
|
|
6707
6703
|
((context | 32243712) ^ 32243712) |
|
|
6708
6704
|
67108864 |
|
|
6709
6705
|
generatorAndAsyncFlags |
|
|
6710
|
-
(isGenerator ? 0 :
|
|
6706
|
+
(isGenerator ? 0 : 268435456);
|
|
6711
6707
|
if (scope)
|
|
6712
6708
|
scope = addChildScope(scope, 512);
|
|
6713
6709
|
const params = parseFormalParametersOrFormalList(parser, context | 8388608, scope, inGroup, 1);
|
|
@@ -6745,14 +6741,14 @@ function parseArrayExpressionOrPattern(parser, context, scope, skipInitializer,
|
|
|
6745
6741
|
let left;
|
|
6746
6742
|
const { token, tokenPos, linePos, colPos, tokenValue } = parser;
|
|
6747
6743
|
if (token & 143360) {
|
|
6748
|
-
left = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
6744
|
+
left = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
6749
6745
|
if (parser.token === 1077936157) {
|
|
6750
6746
|
if (parser.assignable & 2)
|
|
6751
6747
|
report(parser, 24);
|
|
6752
6748
|
nextToken(parser, context | 32768);
|
|
6753
6749
|
if (scope)
|
|
6754
6750
|
addVarOrBlock(parser, context, scope, tokenValue, kind, origin);
|
|
6755
|
-
const right = parseExpression(parser, context, 1,
|
|
6751
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6756
6752
|
left = finishNode(parser, context, tokenPos, linePos, colPos, isPattern
|
|
6757
6753
|
? {
|
|
6758
6754
|
type: 'AssignmentPattern',
|
|
@@ -6891,7 +6887,7 @@ function parseArrayOrObjectAssignmentPattern(parser, context, destructible, inGr
|
|
|
6891
6887
|
if (!isPattern)
|
|
6892
6888
|
reinterpretToPattern(parser, node);
|
|
6893
6889
|
const { tokenPos, linePos, colPos } = parser;
|
|
6894
|
-
const right = parseExpression(parser, context, 1,
|
|
6890
|
+
const right = parseExpression(parser, context, 1, inGroup, tokenPos, linePos, colPos);
|
|
6895
6891
|
parser.destructible =
|
|
6896
6892
|
((destructible | 64 | 8) ^
|
|
6897
6893
|
(8 | 64)) |
|
|
@@ -6917,7 +6913,7 @@ function parseSpreadOrRestElement(parser, context, scope, closingToken, kind, or
|
|
|
6917
6913
|
let { token, tokenValue, tokenPos, linePos, colPos } = parser;
|
|
6918
6914
|
if (token & (4096 | 143360)) {
|
|
6919
6915
|
parser.assignable = 1;
|
|
6920
|
-
argument = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
6916
|
+
argument = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
6921
6917
|
token = parser.token;
|
|
6922
6918
|
argument = parseMemberOrUpdateExpression(parser, context, argument, inGroup, 0, tokenPos, linePos, colPos);
|
|
6923
6919
|
if (parser.token !== 18 && parser.token !== closingToken) {
|
|
@@ -7012,7 +7008,7 @@ function parseSpreadOrRestElement(parser, context, scope, closingToken, kind, or
|
|
|
7012
7008
|
if (destructible & 16)
|
|
7013
7009
|
report(parser, 24);
|
|
7014
7010
|
reinterpretToPattern(parser, argument);
|
|
7015
|
-
const right = parseExpression(parser, context, 1,
|
|
7011
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7016
7012
|
argument = finishNode(parser, context, tokenPos, linePos, colPos, isPattern
|
|
7017
7013
|
? {
|
|
7018
7014
|
type: 'AssignmentPattern',
|
|
@@ -7084,7 +7080,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7084
7080
|
let value;
|
|
7085
7081
|
const t = parser.token;
|
|
7086
7082
|
if (parser.token & (143360 | 4096) || parser.token === 121) {
|
|
7087
|
-
key = parseIdentifier(parser, context
|
|
7083
|
+
key = parseIdentifier(parser, context);
|
|
7088
7084
|
if (parser.token === 18 || parser.token === 1074790415 || parser.token === 1077936157) {
|
|
7089
7085
|
state |= 4;
|
|
7090
7086
|
if (context & 1024 && (token & 537079808) === 537079808) {
|
|
@@ -7097,7 +7093,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7097
7093
|
addVarOrBlock(parser, context, scope, tokenValue, kind, origin);
|
|
7098
7094
|
if (consumeOpt(parser, context | 32768, 1077936157)) {
|
|
7099
7095
|
destructible |= 8;
|
|
7100
|
-
const right = parseExpression(parser, context, 1,
|
|
7096
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7101
7097
|
destructible |=
|
|
7102
7098
|
parser.destructible & 256
|
|
7103
7099
|
? 256
|
|
@@ -7106,7 +7102,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7106
7102
|
: 0;
|
|
7107
7103
|
value = finishNode(parser, context, tokenPos, linePos, colPos, {
|
|
7108
7104
|
type: 'AssignmentPattern',
|
|
7109
|
-
left: context &
|
|
7105
|
+
left: context & 536870912 ? Object.assign({}, key) : key,
|
|
7110
7106
|
right
|
|
7111
7107
|
});
|
|
7112
7108
|
}
|
|
@@ -7114,7 +7110,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7114
7110
|
destructible |=
|
|
7115
7111
|
(token === 209008 ? 128 : 0) |
|
|
7116
7112
|
(token === 121 ? 16 : 0);
|
|
7117
|
-
value = context &
|
|
7113
|
+
value = context & 536870912 ? Object.assign({}, key) : key;
|
|
7118
7114
|
}
|
|
7119
7115
|
}
|
|
7120
7116
|
else if (consumeOpt(parser, context | 32768, 21)) {
|
|
@@ -7125,7 +7121,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7125
7121
|
const tokenAfterColon = parser.token;
|
|
7126
7122
|
const valueAfterColon = parser.tokenValue;
|
|
7127
7123
|
destructible |= t === 121 ? 16 : 0;
|
|
7128
|
-
value = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
7124
|
+
value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
7129
7125
|
const { token } = parser;
|
|
7130
7126
|
value = parseMemberOrUpdateExpression(parser, context, value, inGroup, 0, tokenPos, linePos, colPos);
|
|
7131
7127
|
if (parser.token === 18 || parser.token === 1074790415) {
|
|
@@ -7246,7 +7242,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7246
7242
|
report(parser, 129);
|
|
7247
7243
|
state |= 16;
|
|
7248
7244
|
}
|
|
7249
|
-
key = parseIdentifier(parser, context
|
|
7245
|
+
key = parseIdentifier(parser, context);
|
|
7250
7246
|
state |=
|
|
7251
7247
|
token === 12402
|
|
7252
7248
|
? 256
|
|
@@ -7275,7 +7271,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7275
7271
|
state |=
|
|
7276
7272
|
8 | 1 | (token === 209007 ? 16 : 0);
|
|
7277
7273
|
if (parser.token & 143360) {
|
|
7278
|
-
key = parseIdentifier(parser, context
|
|
7274
|
+
key = parseIdentifier(parser, context);
|
|
7279
7275
|
}
|
|
7280
7276
|
else if ((parser.token & 134217728) === 134217728) {
|
|
7281
7277
|
key = parseLiteral(parser, context);
|
|
@@ -7315,7 +7311,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7315
7311
|
if (tokenValue === '__proto__')
|
|
7316
7312
|
prototypeCount++;
|
|
7317
7313
|
if (parser.token & 143360) {
|
|
7318
|
-
value = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
7314
|
+
value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
7319
7315
|
const { token, tokenValue: valueAfterColon } = parser;
|
|
7320
7316
|
value = parseMemberOrUpdateExpression(parser, context, value, inGroup, 0, tokenPos, linePos, colPos);
|
|
7321
7317
|
if (parser.token === 18 || parser.token === 1074790415) {
|
|
@@ -7416,7 +7412,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7416
7412
|
nextToken(parser, context | 32768);
|
|
7417
7413
|
const { tokenPos, linePos, colPos, tokenValue, token: tokenAfterColon } = parser;
|
|
7418
7414
|
if (parser.token & 143360) {
|
|
7419
|
-
value = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
7415
|
+
value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
7420
7416
|
const { token } = parser;
|
|
7421
7417
|
value = parseMemberOrUpdateExpression(parser, context, value, inGroup, 0, tokenPos, linePos, colPos);
|
|
7422
7418
|
if ((parser.token & 4194304) === 4194304) {
|
|
@@ -7522,7 +7518,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7522
7518
|
state |= 8;
|
|
7523
7519
|
if (parser.token & 143360) {
|
|
7524
7520
|
const { token, line, index } = parser;
|
|
7525
|
-
key = parseIdentifier(parser, context
|
|
7521
|
+
key = parseIdentifier(parser, context);
|
|
7526
7522
|
state |= 1;
|
|
7527
7523
|
if (parser.token === 67174411) {
|
|
7528
7524
|
destructible |= 16;
|
|
@@ -7636,7 +7632,7 @@ function parseMethodFormals(parser, context, scope, kind, type, inGroup) {
|
|
|
7636
7632
|
if (parser.token === 1077936157) {
|
|
7637
7633
|
nextToken(parser, context | 32768);
|
|
7638
7634
|
isSimpleParameterList = 1;
|
|
7639
|
-
const right = parseExpression(parser, context, 1,
|
|
7635
|
+
const right = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7640
7636
|
left = finishNode(parser, context, tokenPos, linePos, colPos, {
|
|
7641
7637
|
type: 'AssignmentPattern',
|
|
7642
7638
|
left: left,
|
|
@@ -7663,14 +7659,14 @@ function parseMethodFormals(parser, context, scope, kind, type, inGroup) {
|
|
|
7663
7659
|
}
|
|
7664
7660
|
function parseComputedPropertyName(parser, context, inGroup) {
|
|
7665
7661
|
nextToken(parser, context | 32768);
|
|
7666
|
-
const key = parseExpression(parser, (context | 134217728) ^ 134217728, 1,
|
|
7662
|
+
const key = parseExpression(parser, (context | 134217728) ^ 134217728, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7667
7663
|
consume(parser, context, 20);
|
|
7668
7664
|
return key;
|
|
7669
7665
|
}
|
|
7670
7666
|
function parseParenthesizedExpression(parser, context, canAssign, kind, origin, start, line, column) {
|
|
7671
7667
|
parser.flags = (parser.flags | 128) ^ 128;
|
|
7672
7668
|
const { tokenPos: piStart, linePos: plStart, colPos: pcStart } = parser;
|
|
7673
|
-
nextToken(parser, context | 32768 |
|
|
7669
|
+
nextToken(parser, context | 32768 | 268435456);
|
|
7674
7670
|
const scope = context & 64 ? addChildScope(createScope(), 1024) : void 0;
|
|
7675
7671
|
context = (context | 134217728) ^ 134217728;
|
|
7676
7672
|
if (consumeOpt(parser, context, 16)) {
|
|
@@ -7689,7 +7685,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7689
7685
|
if (token & (143360 | 4096)) {
|
|
7690
7686
|
if (scope)
|
|
7691
7687
|
addBlockName(parser, context, scope, parser.tokenValue, 1, 0);
|
|
7692
|
-
expr = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
7688
|
+
expr = parsePrimaryExpression(parser, context, kind, 0, 1, 1, 1, tokenPos, linePos, colPos);
|
|
7693
7689
|
if (parser.token === 16 || parser.token === 18) {
|
|
7694
7690
|
if (parser.assignable & 2) {
|
|
7695
7691
|
destructible |= 16;
|
|
@@ -7716,8 +7712,8 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7716
7712
|
else if ((token & 2097152) === 2097152) {
|
|
7717
7713
|
expr =
|
|
7718
7714
|
token === 2162700
|
|
7719
|
-
? parseObjectLiteralOrPattern(parser, context |
|
|
7720
|
-
: parseArrayExpressionOrPattern(parser, context |
|
|
7715
|
+
? parseObjectLiteralOrPattern(parser, context | 268435456, scope, 0, 1, 0, kind, origin, tokenPos, linePos, colPos)
|
|
7716
|
+
: parseArrayExpressionOrPattern(parser, context | 268435456, scope, 0, 1, 0, kind, origin, tokenPos, linePos, colPos);
|
|
7721
7717
|
destructible |= parser.destructible;
|
|
7722
7718
|
isSimpleParameterList = 1;
|
|
7723
7719
|
parser.assignable = 2;
|
|
@@ -7744,7 +7740,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7744
7740
|
}
|
|
7745
7741
|
else {
|
|
7746
7742
|
destructible |= 16;
|
|
7747
|
-
expr = parseExpression(parser, context, 1,
|
|
7743
|
+
expr = parseExpression(parser, context, 1, 1, tokenPos, linePos, colPos);
|
|
7748
7744
|
if (isSequence && (parser.token === 16 || parser.token === 18)) {
|
|
7749
7745
|
expressions.push(expr);
|
|
7750
7746
|
}
|
|
@@ -7756,7 +7752,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7756
7752
|
}
|
|
7757
7753
|
if (isSequence) {
|
|
7758
7754
|
while (consumeOpt(parser, context | 32768, 18)) {
|
|
7759
|
-
expressions.push(parseExpression(parser, context, 1,
|
|
7755
|
+
expressions.push(parseExpression(parser, context, 1, 1, parser.tokenPos, parser.linePos, parser.colPos));
|
|
7760
7756
|
}
|
|
7761
7757
|
parser.assignable = 2;
|
|
7762
7758
|
expr = finishNode(parser, context, iStart, lStart, cStart, {
|
|
@@ -7823,7 +7819,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7823
7819
|
}
|
|
7824
7820
|
function parseIdentifierOrArrow(parser, context, start, line, column) {
|
|
7825
7821
|
const { tokenValue } = parser;
|
|
7826
|
-
const expr = parseIdentifier(parser, context
|
|
7822
|
+
const expr = parseIdentifier(parser, context);
|
|
7827
7823
|
parser.assignable = 1;
|
|
7828
7824
|
if (parser.token === 10) {
|
|
7829
7825
|
let scope = void 0;
|
|
@@ -7861,7 +7857,7 @@ function parseArrowFunctionExpression(parser, context, scope, params, isAsync, s
|
|
|
7861
7857
|
reportScopeError(scope.scopeError);
|
|
7862
7858
|
}
|
|
7863
7859
|
if (expression) {
|
|
7864
|
-
body = parseExpression(parser, context, 1, 0,
|
|
7860
|
+
body = parseExpression(parser, context & 16384 ? context | 33554432 : context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7865
7861
|
}
|
|
7866
7862
|
else {
|
|
7867
7863
|
if (scope)
|
|
@@ -7942,7 +7938,7 @@ function parseFormalParametersOrFormalList(parser, context, scope, inGroup, kind
|
|
|
7942
7938
|
if (parser.token === 1077936157) {
|
|
7943
7939
|
nextToken(parser, context | 32768);
|
|
7944
7940
|
isSimpleParameterList = 1;
|
|
7945
|
-
const right = parseExpression(parser, context, 1,
|
|
7941
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7946
7942
|
left = finishNode(parser, context, tokenPos, linePos, colPos, {
|
|
7947
7943
|
type: 'AssignmentPattern',
|
|
7948
7944
|
left,
|
|
@@ -7968,7 +7964,7 @@ function parseMembeExpressionNoCall(parser, context, expr, inGroup, start, line,
|
|
|
7968
7964
|
const { token } = parser;
|
|
7969
7965
|
if (token & 67108864) {
|
|
7970
7966
|
if (token === 67108877) {
|
|
7971
|
-
nextToken(parser, context |
|
|
7967
|
+
nextToken(parser, context | 268435456);
|
|
7972
7968
|
parser.assignable = 1;
|
|
7973
7969
|
const property = parsePropertyOrPrivatePropertyName(parser, context);
|
|
7974
7970
|
return parseMembeExpressionNoCall(parser, context, finishNode(parser, context, start, line, column, {
|
|
@@ -8005,7 +8001,7 @@ function parseMembeExpressionNoCall(parser, context, expr, inGroup, start, line,
|
|
|
8005
8001
|
return expr;
|
|
8006
8002
|
}
|
|
8007
8003
|
function parseNewExpression(parser, context, inGroup, start, line, column) {
|
|
8008
|
-
const id = parseIdentifier(parser, context | 32768
|
|
8004
|
+
const id = parseIdentifier(parser, context | 32768);
|
|
8009
8005
|
const { tokenPos, linePos, colPos } = parser;
|
|
8010
8006
|
if (consumeOpt(parser, context, 67108877)) {
|
|
8011
8007
|
if (context & 67108864 && parser.token === 143494) {
|
|
@@ -8018,7 +8014,7 @@ function parseNewExpression(parser, context, inGroup, start, line, column) {
|
|
|
8018
8014
|
if ((parser.token & 16842752) === 16842752) {
|
|
8019
8015
|
report(parser, 63, KeywordDescTable[parser.token & 255]);
|
|
8020
8016
|
}
|
|
8021
|
-
const expr = parsePrimaryExpression(parser, context, 2, 1, 0,
|
|
8017
|
+
const expr = parsePrimaryExpression(parser, context, 2, 1, 0, inGroup, 1, tokenPos, linePos, colPos);
|
|
8022
8018
|
context = (context | 134217728) ^ 134217728;
|
|
8023
8019
|
if (parser.token === 67108991)
|
|
8024
8020
|
report(parser, 163);
|
|
@@ -8031,7 +8027,7 @@ function parseNewExpression(parser, context, inGroup, start, line, column) {
|
|
|
8031
8027
|
});
|
|
8032
8028
|
}
|
|
8033
8029
|
function parseMetaProperty(parser, context, meta, start, line, column) {
|
|
8034
|
-
const property = parseIdentifier(parser, context
|
|
8030
|
+
const property = parseIdentifier(parser, context);
|
|
8035
8031
|
return finishNode(parser, context, start, line, column, {
|
|
8036
8032
|
type: 'MetaProperty',
|
|
8037
8033
|
meta,
|
|
@@ -8047,7 +8043,7 @@ function parseAsyncArrowAfterIdent(parser, context, canAssign, start, line, colu
|
|
|
8047
8043
|
if ((parser.token & 537079808) === 537079808) {
|
|
8048
8044
|
parser.flags |= 512;
|
|
8049
8045
|
}
|
|
8050
|
-
return parseArrowFromIdentifier(parser, context, parser.tokenValue, parseIdentifier(parser, context
|
|
8046
|
+
return parseArrowFromIdentifier(parser, context, parser.tokenValue, parseIdentifier(parser, context), 0, canAssign, 1, start, line, column);
|
|
8051
8047
|
}
|
|
8052
8048
|
function parseAsyncArrowOrCallExpression(parser, context, callee, canAssign, kind, origin, flags, start, line, column) {
|
|
8053
8049
|
nextToken(parser, context | 32768);
|
|
@@ -8077,7 +8073,7 @@ function parseAsyncArrowOrCallExpression(parser, context, callee, canAssign, kin
|
|
|
8077
8073
|
if (token & (143360 | 4096)) {
|
|
8078
8074
|
if (scope)
|
|
8079
8075
|
addBlockName(parser, context, scope, parser.tokenValue, kind, 0);
|
|
8080
|
-
expr = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
8076
|
+
expr = parsePrimaryExpression(parser, context, kind, 0, 1, 1, 1, tokenPos, linePos, colPos);
|
|
8081
8077
|
if (parser.token === 16 || parser.token === 18) {
|
|
8082
8078
|
if (parser.assignable & 2) {
|
|
8083
8079
|
destructible |= 16;
|
|
@@ -8129,11 +8125,11 @@ function parseAsyncArrowOrCallExpression(parser, context, callee, canAssign, kin
|
|
|
8129
8125
|
isSimpleParameterList = 1;
|
|
8130
8126
|
}
|
|
8131
8127
|
else {
|
|
8132
|
-
expr = parseExpression(parser, context, 1, 0,
|
|
8128
|
+
expr = parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos);
|
|
8133
8129
|
destructible = parser.assignable;
|
|
8134
8130
|
params.push(expr);
|
|
8135
8131
|
while (consumeOpt(parser, context | 32768, 18)) {
|
|
8136
|
-
params.push(parseExpression(parser, context, 1, 0,
|
|
8132
|
+
params.push(parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos));
|
|
8137
8133
|
}
|
|
8138
8134
|
destructible |= parser.assignable;
|
|
8139
8135
|
consume(parser, context, 16);
|
|
@@ -8228,7 +8224,7 @@ function parseClassDeclaration(parser, context, scope, flags, start, line, colum
|
|
|
8228
8224
|
}
|
|
8229
8225
|
}
|
|
8230
8226
|
}
|
|
8231
|
-
id = parseIdentifier(parser, context
|
|
8227
|
+
id = parseIdentifier(parser, context);
|
|
8232
8228
|
}
|
|
8233
8229
|
else {
|
|
8234
8230
|
if ((flags & 1) === 0)
|
|
@@ -8275,7 +8271,7 @@ function parseClassExpression(parser, context, inGroup, start, line, column) {
|
|
|
8275
8271
|
if ((parser.token & 537079808) === 537079808) {
|
|
8276
8272
|
report(parser, 116);
|
|
8277
8273
|
}
|
|
8278
|
-
id = parseIdentifier(parser, context
|
|
8274
|
+
id = parseIdentifier(parser, context);
|
|
8279
8275
|
}
|
|
8280
8276
|
let inheritedContext = context;
|
|
8281
8277
|
if (consumeOpt(parser, context | 32768, 20567)) {
|
|
@@ -8313,7 +8309,7 @@ function parseDecorators(parser, context) {
|
|
|
8313
8309
|
}
|
|
8314
8310
|
function parseDecoratorList(parser, context, start, line, column) {
|
|
8315
8311
|
nextToken(parser, context | 32768);
|
|
8316
|
-
let expression = parsePrimaryExpression(parser, context, 2, 0, 1, 0,
|
|
8312
|
+
let expression = parsePrimaryExpression(parser, context, 2, 0, 1, 0, 1, start, line, column);
|
|
8317
8313
|
expression = parseMemberOrUpdateExpression(parser, context, expression, 0, 0, start, line, column);
|
|
8318
8314
|
return finishNode(parser, context, start, line, column, {
|
|
8319
8315
|
type: 'Decorator',
|
|
@@ -8356,7 +8352,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8356
8352
|
let key = null;
|
|
8357
8353
|
const { token, tokenPos, linePos, colPos } = parser;
|
|
8358
8354
|
if (token & (143360 | 36864)) {
|
|
8359
|
-
key = parseIdentifier(parser, context
|
|
8355
|
+
key = parseIdentifier(parser, context);
|
|
8360
8356
|
switch (token) {
|
|
8361
8357
|
case 36972:
|
|
8362
8358
|
if (!isStatic &&
|
|
@@ -8414,7 +8410,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8414
8410
|
return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
|
|
8415
8411
|
}
|
|
8416
8412
|
else if (token === 122) {
|
|
8417
|
-
key = parseIdentifier(parser, context
|
|
8413
|
+
key = parseIdentifier(parser, context);
|
|
8418
8414
|
if (parser.token !== 67174411)
|
|
8419
8415
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
8420
8416
|
}
|
|
@@ -8423,7 +8419,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8423
8419
|
}
|
|
8424
8420
|
if (kind & (8 | 16 | 768)) {
|
|
8425
8421
|
if (parser.token & 143360) {
|
|
8426
|
-
key = parseIdentifier(parser, context
|
|
8422
|
+
key = parseIdentifier(parser, context);
|
|
8427
8423
|
}
|
|
8428
8424
|
else if ((parser.token & 134217728) === 134217728) {
|
|
8429
8425
|
key = parseLiteral(parser, context);
|
|
@@ -8433,7 +8429,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8433
8429
|
key = parseComputedPropertyName(parser, context, 0);
|
|
8434
8430
|
}
|
|
8435
8431
|
else if (parser.token === 122) {
|
|
8436
|
-
key = parseIdentifier(parser, context
|
|
8432
|
+
key = parseIdentifier(parser, context);
|
|
8437
8433
|
}
|
|
8438
8434
|
else if (context & 1 && parser.token === 131) {
|
|
8439
8435
|
kind |= 4096;
|
|
@@ -8521,7 +8517,14 @@ function parsePropertyDefinition(parser, context, key, state, decorators, start,
|
|
|
8521
8517
|
const { tokenPos, linePos, colPos } = parser;
|
|
8522
8518
|
if (parser.token === 537079928)
|
|
8523
8519
|
report(parser, 116);
|
|
8524
|
-
|
|
8520
|
+
const modifierFlags = (state & 64) === 0
|
|
8521
|
+
? 31981568
|
|
8522
|
+
: 14680064;
|
|
8523
|
+
context =
|
|
8524
|
+
((context | modifierFlags) ^ modifierFlags) |
|
|
8525
|
+
((state & 88) << 18) |
|
|
8526
|
+
100925440;
|
|
8527
|
+
value = parsePrimaryExpression(parser, context | 16384, 2, 0, 1, 0, 1, tokenPos, linePos, colPos);
|
|
8525
8528
|
if ((parser.token & 1073741824) !== 1073741824 ||
|
|
8526
8529
|
(parser.token & 4194304) === 4194304) {
|
|
8527
8530
|
value = parseMemberOrUpdateExpression(parser, context | 16384, value, 0, 0, tokenPos, linePos, colPos);
|
|
@@ -8729,7 +8732,7 @@ function parseJSXAttributes(parser, context) {
|
|
|
8729
8732
|
function parseJSXSpreadAttribute(parser, context, start, line, column) {
|
|
8730
8733
|
nextToken(parser, context);
|
|
8731
8734
|
consume(parser, context, 14);
|
|
8732
|
-
const expression = parseExpression(parser, context, 1, 0,
|
|
8735
|
+
const expression = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
8733
8736
|
consume(parser, context, 1074790415);
|
|
8734
8737
|
return finishNode(parser, context, start, line, column, {
|
|
8735
8738
|
type: 'JSXSpreadAttribute',
|
|
@@ -8789,7 +8792,7 @@ function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start,
|
|
|
8789
8792
|
expression = parseJSXEmptyExpression(parser, context, parser.startPos, parser.startLine, parser.startColumn);
|
|
8790
8793
|
}
|
|
8791
8794
|
else {
|
|
8792
|
-
expression = parseExpression(parser, context, 1, 0,
|
|
8795
|
+
expression = parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos);
|
|
8793
8796
|
}
|
|
8794
8797
|
if (inJSXChild) {
|
|
8795
8798
|
consume(parser, context, 1074790415);
|
|
@@ -8804,7 +8807,7 @@ function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start,
|
|
|
8804
8807
|
}
|
|
8805
8808
|
function parseJSXSpreadChild(parser, context, start, line, column) {
|
|
8806
8809
|
consume(parser, context, 14);
|
|
8807
|
-
const expression = parseExpression(parser, context, 1, 0,
|
|
8810
|
+
const expression = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
8808
8811
|
consume(parser, context, 1074790415);
|
|
8809
8812
|
return finishNode(parser, context, start, line, column, {
|
|
8810
8813
|
type: 'JSXSpreadChild',
|
|
@@ -8832,7 +8835,7 @@ var estree = /*#__PURE__*/Object.freeze({
|
|
|
8832
8835
|
__proto__: null
|
|
8833
8836
|
});
|
|
8834
8837
|
|
|
8835
|
-
var version$1 = "4.4.
|
|
8838
|
+
var version$1 = "4.4.4";
|
|
8836
8839
|
|
|
8837
8840
|
const version = version$1;
|
|
8838
8841
|
function parseScript(source, options) {
|