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.esm.mjs
CHANGED
|
@@ -1524,7 +1524,7 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
|
|
|
1524
1524
|
return 122;
|
|
1525
1525
|
}
|
|
1526
1526
|
if ((token & 20480) === 20480) {
|
|
1527
|
-
if (context &
|
|
1527
|
+
if (context & 268435456 && (context & 8192) === 0) {
|
|
1528
1528
|
return token;
|
|
1529
1529
|
}
|
|
1530
1530
|
else {
|
|
@@ -1533,12 +1533,12 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
|
|
|
1533
1533
|
}
|
|
1534
1534
|
return 143483;
|
|
1535
1535
|
}
|
|
1536
|
-
if (context &
|
|
1536
|
+
if (context & 268435456 &&
|
|
1537
1537
|
(context & 8192) === 0 &&
|
|
1538
1538
|
(token & 20480) === 20480)
|
|
1539
1539
|
return token;
|
|
1540
1540
|
if (token === 241773) {
|
|
1541
|
-
return context &
|
|
1541
|
+
return context & 268435456
|
|
1542
1542
|
? 143483
|
|
1543
1543
|
: context & 2097152
|
|
1544
1544
|
? 121
|
|
@@ -4357,10 +4357,9 @@ function scanJSXIdentifier(parser) {
|
|
|
4357
4357
|
return parser.token;
|
|
4358
4358
|
}
|
|
4359
4359
|
|
|
4360
|
-
function matchOrInsertSemicolon(parser, context
|
|
4360
|
+
function matchOrInsertSemicolon(parser, context) {
|
|
4361
4361
|
if ((parser.flags & 1) === 0 &&
|
|
4362
|
-
(parser.token & 1048576) !== 1048576
|
|
4363
|
-
!specDeviation) {
|
|
4362
|
+
(parser.token & 1048576) !== 1048576) {
|
|
4364
4363
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
4365
4364
|
}
|
|
4366
4365
|
if (!consumeOpt(parser, context, 1074790417)) {
|
|
@@ -4752,7 +4751,7 @@ function parseSource(source, options, context) {
|
|
|
4752
4751
|
if (options.ranges)
|
|
4753
4752
|
context |= 2;
|
|
4754
4753
|
if (options.uniqueKeyInPattern)
|
|
4755
|
-
context |=
|
|
4754
|
+
context |= 536870912;
|
|
4756
4755
|
if (options.lexical)
|
|
4757
4756
|
context |= 64;
|
|
4758
4757
|
if (options.webcompat)
|
|
@@ -4769,10 +4768,6 @@ function parseSource(source, options, context) {
|
|
|
4769
4768
|
context |= 1024;
|
|
4770
4769
|
if (options.jsx)
|
|
4771
4770
|
context |= 16;
|
|
4772
|
-
if (options.identifierPattern)
|
|
4773
|
-
context |= 268435456;
|
|
4774
|
-
if (options.specDeviation)
|
|
4775
|
-
context |= 536870912;
|
|
4776
4771
|
if (options.source)
|
|
4777
4772
|
sourceFile = options.source;
|
|
4778
4773
|
if (options.onComment != null) {
|
|
@@ -4824,7 +4819,7 @@ function parseSource(source, options, context) {
|
|
|
4824
4819
|
return node;
|
|
4825
4820
|
}
|
|
4826
4821
|
function parseStatementList(parser, context, scope) {
|
|
4827
|
-
nextToken(parser, context | 32768 |
|
|
4822
|
+
nextToken(parser, context | 32768 | 268435456);
|
|
4828
4823
|
const statements = [];
|
|
4829
4824
|
while (parser.token === 134283267) {
|
|
4830
4825
|
const { index, tokenPos, tokenValue, linePos, colPos, token } = parser;
|
|
@@ -4957,14 +4952,14 @@ function parseExpressionOrLabelledStatement(parser, context, scope, origin, labe
|
|
|
4957
4952
|
let expr;
|
|
4958
4953
|
switch (token) {
|
|
4959
4954
|
case 241739:
|
|
4960
|
-
expr = parseIdentifier(parser, context
|
|
4955
|
+
expr = parseIdentifier(parser, context);
|
|
4961
4956
|
if (context & 1024)
|
|
4962
4957
|
report(parser, 83);
|
|
4963
4958
|
if (parser.token === 69271571)
|
|
4964
4959
|
report(parser, 82);
|
|
4965
4960
|
break;
|
|
4966
4961
|
default:
|
|
4967
|
-
expr = parsePrimaryExpression(parser, context, 2, 0, 1, 0,
|
|
4962
|
+
expr = parsePrimaryExpression(parser, context, 2, 0, 1, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
|
|
4968
4963
|
}
|
|
4969
4964
|
if (token & 143360 && parser.token === 21) {
|
|
4970
4965
|
return parseLabelledStatement(parser, context, scope, origin, labels, tokenValue, expr, token, allowFuncDecl, start, line, column);
|
|
@@ -5026,7 +5021,7 @@ function parseLabelledStatement(parser, context, scope, origin, labels, value, e
|
|
|
5026
5021
|
}
|
|
5027
5022
|
function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, origin, labels, allowFuncDecl, start, line, column) {
|
|
5028
5023
|
const { token, tokenValue } = parser;
|
|
5029
|
-
let expr = parseIdentifier(parser, context
|
|
5024
|
+
let expr = parseIdentifier(parser, context);
|
|
5030
5025
|
if (parser.token === 21) {
|
|
5031
5026
|
return parseLabelledStatement(parser, context, scope, origin, labels, tokenValue, expr, token, 1, start, line, column);
|
|
5032
5027
|
}
|
|
@@ -5194,7 +5189,7 @@ function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
|
5194
5189
|
let label = null;
|
|
5195
5190
|
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5196
5191
|
const { tokenValue } = parser;
|
|
5197
|
-
label = parseIdentifier(parser, context | 32768
|
|
5192
|
+
label = parseIdentifier(parser, context | 32768);
|
|
5198
5193
|
if (!isValidLabel(parser, labels, tokenValue, 1))
|
|
5199
5194
|
report(parser, 135, tokenValue);
|
|
5200
5195
|
}
|
|
@@ -5209,7 +5204,7 @@ function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
|
5209
5204
|
let label = null;
|
|
5210
5205
|
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5211
5206
|
const { tokenValue } = parser;
|
|
5212
|
-
label = parseIdentifier(parser, context | 32768
|
|
5207
|
+
label = parseIdentifier(parser, context | 32768);
|
|
5213
5208
|
if (!isValidLabel(parser, labels, tokenValue, 0))
|
|
5214
5209
|
report(parser, 135, tokenValue);
|
|
5215
5210
|
}
|
|
@@ -5320,7 +5315,7 @@ function parseDoWhileStatement(parser, context, scope, labels, start, line, colu
|
|
|
5320
5315
|
}
|
|
5321
5316
|
function parseLetIdentOrVarDeclarationStatement(parser, context, scope, origin, start, line, column) {
|
|
5322
5317
|
const { token, tokenValue } = parser;
|
|
5323
|
-
let expr = parseIdentifier(parser, context
|
|
5318
|
+
let expr = parseIdentifier(parser, context);
|
|
5324
5319
|
if (parser.token & (143360 | 2097152)) {
|
|
5325
5320
|
const declarations = parseVariableDeclarationList(parser, context, scope, 8, 0);
|
|
5326
5321
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
@@ -5390,7 +5385,7 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
|
|
|
5390
5385
|
const id = parseBindingPattern(parser, context, scope, kind, origin, tokenPos, linePos, colPos);
|
|
5391
5386
|
if (parser.token === 1077936157) {
|
|
5392
5387
|
nextToken(parser, context | 32768);
|
|
5393
|
-
init = parseExpression(parser, context, 1, 0,
|
|
5388
|
+
init = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5394
5389
|
if (origin & 32 || (token & 2097152) === 0) {
|
|
5395
5390
|
if (parser.token === 274549 ||
|
|
5396
5391
|
(parser.token === 8738868 &&
|
|
@@ -5425,7 +5420,7 @@ function parseForStatement(parser, context, scope, labels, start, line, column)
|
|
|
5425
5420
|
const { token, tokenPos, linePos, colPos } = parser;
|
|
5426
5421
|
if (isVarDecl) {
|
|
5427
5422
|
if (token === 241739) {
|
|
5428
|
-
init = parseIdentifier(parser, context
|
|
5423
|
+
init = parseIdentifier(parser, context);
|
|
5429
5424
|
if (parser.token & (143360 | 2097152)) {
|
|
5430
5425
|
if (parser.token === 8738868) {
|
|
5431
5426
|
if (context & 1024)
|
|
@@ -5493,7 +5488,7 @@ function parseForStatement(parser, context, scope, labels, start, line, column)
|
|
|
5493
5488
|
report(parser, 78, forAwait ? 'await' : 'of');
|
|
5494
5489
|
reinterpretToPattern(parser, init);
|
|
5495
5490
|
nextToken(parser, context | 32768);
|
|
5496
|
-
right = parseExpression(parser, context, 1, 0,
|
|
5491
|
+
right = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5497
5492
|
consume(parser, context | 32768, 16);
|
|
5498
5493
|
const body = parseIterationStatementBody(parser, context, scope, labels);
|
|
5499
5494
|
return finishNode(parser, context, start, line, column, {
|
|
@@ -5553,7 +5548,7 @@ function parseRestrictedIdentifier(parser, context, scope) {
|
|
|
5553
5548
|
report(parser, 116);
|
|
5554
5549
|
if (scope)
|
|
5555
5550
|
addBlockName(parser, context, scope, parser.tokenValue, 8, 0);
|
|
5556
|
-
return parseIdentifier(parser, context
|
|
5551
|
+
return parseIdentifier(parser, context);
|
|
5557
5552
|
}
|
|
5558
5553
|
function parseImportDeclaration(parser, context, scope) {
|
|
5559
5554
|
const start = parser.tokenPos;
|
|
@@ -5626,7 +5621,9 @@ function parseImportNamespaceSpecifier(parser, context, scope) {
|
|
|
5626
5621
|
});
|
|
5627
5622
|
}
|
|
5628
5623
|
function parseModuleSpecifier(parser, context) {
|
|
5629
|
-
consumeOpt(parser, context, 12404)
|
|
5624
|
+
if (!consumeOpt(parser, context, 12404)) {
|
|
5625
|
+
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
5626
|
+
}
|
|
5630
5627
|
if (parser.token !== 134283267)
|
|
5631
5628
|
report(parser, 103, 'Import');
|
|
5632
5629
|
return parseLiteral(parser, context);
|
|
@@ -5635,7 +5632,7 @@ function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers)
|
|
|
5635
5632
|
nextToken(parser, context);
|
|
5636
5633
|
while (parser.token & 143360) {
|
|
5637
5634
|
let { token, tokenValue, tokenPos, linePos, colPos } = parser;
|
|
5638
|
-
const imported = parseIdentifier(parser, context
|
|
5635
|
+
const imported = parseIdentifier(parser, context);
|
|
5639
5636
|
let local;
|
|
5640
5637
|
if (consumeOpt(parser, context, 77934)) {
|
|
5641
5638
|
if ((parser.token & 134217728) === 134217728 || parser.token === 18) {
|
|
@@ -5645,7 +5642,7 @@ function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers)
|
|
|
5645
5642
|
validateBindingIdentifier(parser, context, 16, parser.token, 0);
|
|
5646
5643
|
}
|
|
5647
5644
|
tokenValue = parser.tokenValue;
|
|
5648
|
-
local = parseIdentifier(parser, context
|
|
5645
|
+
local = parseIdentifier(parser, context);
|
|
5649
5646
|
}
|
|
5650
5647
|
else {
|
|
5651
5648
|
validateBindingIdentifier(parser, context, 16, token, 0);
|
|
@@ -5705,7 +5702,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5705
5702
|
break;
|
|
5706
5703
|
case 209007:
|
|
5707
5704
|
const { tokenPos, linePos, colPos } = parser;
|
|
5708
|
-
declaration = parseIdentifier(parser, context
|
|
5705
|
+
declaration = parseIdentifier(parser, context);
|
|
5709
5706
|
const { flags } = parser;
|
|
5710
5707
|
if ((flags & 1) === 0) {
|
|
5711
5708
|
if (parser.token === 86106) {
|
|
@@ -5720,14 +5717,14 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5720
5717
|
else if (parser.token & 143360) {
|
|
5721
5718
|
if (scope)
|
|
5722
5719
|
scope = createArrowHeadParsingScope(parser, context, parser.tokenValue);
|
|
5723
|
-
declaration = parseIdentifier(parser, context
|
|
5720
|
+
declaration = parseIdentifier(parser, context);
|
|
5724
5721
|
declaration = parseArrowFunctionExpression(parser, context, scope, [declaration], 1, tokenPos, linePos, colPos);
|
|
5725
5722
|
}
|
|
5726
5723
|
}
|
|
5727
5724
|
}
|
|
5728
5725
|
break;
|
|
5729
5726
|
default:
|
|
5730
|
-
declaration = parseExpression(parser, context, 1, 0,
|
|
5727
|
+
declaration = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5731
5728
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
5732
5729
|
}
|
|
5733
5730
|
if (scope)
|
|
@@ -5745,7 +5742,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5745
5742
|
if (isNamedDeclaration) {
|
|
5746
5743
|
if (scope)
|
|
5747
5744
|
declareUnboundVariable(parser, parser.tokenValue);
|
|
5748
|
-
exported = parseIdentifier(parser, context
|
|
5745
|
+
exported = parseIdentifier(parser, context);
|
|
5749
5746
|
}
|
|
5750
5747
|
consume(parser, context, 12404);
|
|
5751
5748
|
if (parser.token !== 134283267)
|
|
@@ -5764,7 +5761,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5764
5761
|
const tmpExportedBindings = [];
|
|
5765
5762
|
while (parser.token & 143360) {
|
|
5766
5763
|
const { tokenPos, tokenValue, linePos, colPos } = parser;
|
|
5767
|
-
const local = parseIdentifier(parser, context
|
|
5764
|
+
const local = parseIdentifier(parser, context);
|
|
5768
5765
|
let exported;
|
|
5769
5766
|
if (parser.token === 77934) {
|
|
5770
5767
|
nextToken(parser, context);
|
|
@@ -5775,7 +5772,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5775
5772
|
tmpExportedNames.push(parser.tokenValue);
|
|
5776
5773
|
tmpExportedBindings.push(tokenValue);
|
|
5777
5774
|
}
|
|
5778
|
-
exported = parseIdentifier(parser, context
|
|
5775
|
+
exported = parseIdentifier(parser, context);
|
|
5779
5776
|
}
|
|
5780
5777
|
else {
|
|
5781
5778
|
if (scope) {
|
|
@@ -5849,15 +5846,15 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5849
5846
|
source
|
|
5850
5847
|
});
|
|
5851
5848
|
}
|
|
5852
|
-
function parseExpression(parser, context, canAssign,
|
|
5853
|
-
let expr = parsePrimaryExpression(parser, context, 2, 0, canAssign,
|
|
5849
|
+
function parseExpression(parser, context, canAssign, inGroup, start, line, column) {
|
|
5850
|
+
let expr = parsePrimaryExpression(parser, context, 2, 0, canAssign, inGroup, 1, start, line, column);
|
|
5854
5851
|
expr = parseMemberOrUpdateExpression(parser, context, expr, inGroup, 0, start, line, column);
|
|
5855
5852
|
return parseAssignmentExpression(parser, context, inGroup, 0, start, line, column, expr);
|
|
5856
5853
|
}
|
|
5857
5854
|
function parseSequenceExpression(parser, context, inGroup, start, line, column, expr) {
|
|
5858
5855
|
const expressions = [expr];
|
|
5859
5856
|
while (consumeOpt(parser, context | 32768, 18)) {
|
|
5860
|
-
expressions.push(parseExpression(parser, context, 1,
|
|
5857
|
+
expressions.push(parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos));
|
|
5861
5858
|
}
|
|
5862
5859
|
return finishNode(parser, context, start, line, column, {
|
|
5863
5860
|
type: 'SequenceExpression',
|
|
@@ -5865,7 +5862,7 @@ function parseSequenceExpression(parser, context, inGroup, start, line, column,
|
|
|
5865
5862
|
});
|
|
5866
5863
|
}
|
|
5867
5864
|
function parseExpressions(parser, context, inGroup, canAssign, start, line, column) {
|
|
5868
|
-
const expr = parseExpression(parser, context, canAssign,
|
|
5865
|
+
const expr = parseExpression(parser, context, canAssign, inGroup, start, line, column);
|
|
5869
5866
|
return parser.token === 18
|
|
5870
5867
|
? parseSequenceExpression(parser, context, inGroup, start, line, column, expr)
|
|
5871
5868
|
: expr;
|
|
@@ -5880,7 +5877,7 @@ function parseAssignmentExpression(parser, context, inGroup, isPattern, start, l
|
|
|
5880
5877
|
reinterpretToPattern(parser, left);
|
|
5881
5878
|
}
|
|
5882
5879
|
nextToken(parser, context | 32768);
|
|
5883
|
-
const right = parseExpression(parser, context, 1,
|
|
5880
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5884
5881
|
parser.assignable = 2;
|
|
5885
5882
|
return finishNode(parser, context, start, line, column, isPattern
|
|
5886
5883
|
? {
|
|
@@ -5906,7 +5903,7 @@ function parseAssignmentExpression(parser, context, inGroup, isPattern, start, l
|
|
|
5906
5903
|
function parseAssignmentExpressionOrPattern(parser, context, inGroup, isPattern, start, line, column, left) {
|
|
5907
5904
|
const { token } = parser;
|
|
5908
5905
|
nextToken(parser, context | 32768);
|
|
5909
|
-
const right = parseExpression(parser, context, 1,
|
|
5906
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5910
5907
|
left = finishNode(parser, context, start, line, column, isPattern
|
|
5911
5908
|
? {
|
|
5912
5909
|
type: 'AssignmentPattern',
|
|
@@ -5923,10 +5920,10 @@ function parseAssignmentExpressionOrPattern(parser, context, inGroup, isPattern,
|
|
|
5923
5920
|
return left;
|
|
5924
5921
|
}
|
|
5925
5922
|
function parseConditionalExpression(parser, context, test, start, line, column) {
|
|
5926
|
-
const consequent = parseExpression(parser, (context | 134217728) ^ 134217728, 1, 0,
|
|
5923
|
+
const consequent = parseExpression(parser, (context | 134217728) ^ 134217728, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5927
5924
|
consume(parser, context | 32768, 21);
|
|
5928
5925
|
parser.assignable = 1;
|
|
5929
|
-
const alternate = parseExpression(parser, context, 1, 0,
|
|
5926
|
+
const alternate = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5930
5927
|
parser.assignable = 2;
|
|
5931
5928
|
return finishNode(parser, context, start, line, column, {
|
|
5932
5929
|
type: 'ConditionalExpression',
|
|
@@ -5984,9 +5981,9 @@ function parseUnaryExpression(parser, context, isLHS, start, line, column, inGro
|
|
|
5984
5981
|
prefix: true
|
|
5985
5982
|
});
|
|
5986
5983
|
}
|
|
5987
|
-
function parseAsyncExpression(parser, context, inGroup, isLHS, canAssign,
|
|
5984
|
+
function parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, inNew, start, line, column) {
|
|
5988
5985
|
const { token } = parser;
|
|
5989
|
-
const expr = parseIdentifier(parser, context
|
|
5986
|
+
const expr = parseIdentifier(parser, context);
|
|
5990
5987
|
const { flags } = parser;
|
|
5991
5988
|
if ((flags & 1) === 0) {
|
|
5992
5989
|
if (parser.token === 86106) {
|
|
@@ -6026,7 +6023,7 @@ function parseYieldExpression(parser, context, inGroup, canAssign, start, line,
|
|
|
6026
6023
|
if ((parser.flags & 1) === 0) {
|
|
6027
6024
|
delegate = consumeOpt(parser, context | 32768, 8457014);
|
|
6028
6025
|
if (parser.token & (12288 | 65536) || delegate) {
|
|
6029
|
-
argument = parseExpression(parser, context, 1, 0,
|
|
6026
|
+
argument = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6030
6027
|
}
|
|
6031
6028
|
}
|
|
6032
6029
|
parser.assignable = 2;
|
|
@@ -6129,8 +6126,9 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
6129
6126
|
case 67174411: {
|
|
6130
6127
|
if ((context & 524288) === 0)
|
|
6131
6128
|
report(parser, 26);
|
|
6132
|
-
if (context & 16384)
|
|
6129
|
+
if (context & 16384 && !(context & 33554432)) {
|
|
6133
6130
|
report(parser, 27);
|
|
6131
|
+
}
|
|
6134
6132
|
parser.assignable = 2;
|
|
6135
6133
|
break;
|
|
6136
6134
|
}
|
|
@@ -6138,8 +6136,9 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
6138
6136
|
case 67108877: {
|
|
6139
6137
|
if ((context & 262144) === 0)
|
|
6140
6138
|
report(parser, 27);
|
|
6141
|
-
if (context & 16384)
|
|
6139
|
+
if (context & 16384 && !(context & 33554432)) {
|
|
6142
6140
|
report(parser, 27);
|
|
6141
|
+
}
|
|
6143
6142
|
parser.assignable = 1;
|
|
6144
6143
|
break;
|
|
6145
6144
|
}
|
|
@@ -6149,7 +6148,7 @@ function parseSuperExpression(parser, context, start, line, column) {
|
|
|
6149
6148
|
return finishNode(parser, context, start, line, column, { type: 'Super' });
|
|
6150
6149
|
}
|
|
6151
6150
|
function parseLeftHandSideExpression(parser, context, canAssign, inGroup, isLHS, start, line, column) {
|
|
6152
|
-
const expression = parsePrimaryExpression(parser, context, 2, 0, canAssign,
|
|
6151
|
+
const expression = parsePrimaryExpression(parser, context, 2, 0, canAssign, inGroup, isLHS, start, line, column);
|
|
6153
6152
|
return parseMemberOrUpdateExpression(parser, context, expression, inGroup, 0, start, line, column);
|
|
6154
6153
|
}
|
|
6155
6154
|
function parseUpdateExpression(parser, context, expr, start, line, column) {
|
|
@@ -6173,7 +6172,10 @@ function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain,
|
|
|
6173
6172
|
context = (context | 134217728) ^ 134217728;
|
|
6174
6173
|
switch (parser.token) {
|
|
6175
6174
|
case 67108877: {
|
|
6176
|
-
nextToken(parser, (context |
|
|
6175
|
+
nextToken(parser, (context | 268435456 | 8192) ^ 8192);
|
|
6176
|
+
if (context & 16384 && parser.token === 131 && parser.tokenValue === 'super') {
|
|
6177
|
+
report(parser, 27);
|
|
6178
|
+
}
|
|
6177
6179
|
parser.assignable = 1;
|
|
6178
6180
|
const property = parsePropertyOrPrivatePropertyName(parser, context | 65536);
|
|
6179
6181
|
expr = finishNode(parser, context, start, line, column, {
|
|
@@ -6229,7 +6231,7 @@ function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain,
|
|
|
6229
6231
|
break;
|
|
6230
6232
|
}
|
|
6231
6233
|
case 67108991: {
|
|
6232
|
-
nextToken(parser, (context |
|
|
6234
|
+
nextToken(parser, (context | 268435456 | 8192) ^ 8192);
|
|
6233
6235
|
parser.flags |= 2048;
|
|
6234
6236
|
parser.assignable = 2;
|
|
6235
6237
|
expr = parseOptionalChain(parser, context, expr, start, line, column);
|
|
@@ -6295,7 +6297,7 @@ function parseOptionalChain(parser, context, expr, start, line, column) {
|
|
|
6295
6297
|
else {
|
|
6296
6298
|
if ((parser.token & (143360 | 4096)) === 0)
|
|
6297
6299
|
report(parser, 155);
|
|
6298
|
-
const property = parseIdentifier(parser, context
|
|
6300
|
+
const property = parseIdentifier(parser, context);
|
|
6299
6301
|
parser.assignable = 2;
|
|
6300
6302
|
node = finishNode(parser, context, start, line, column, {
|
|
6301
6303
|
type: 'MemberExpression',
|
|
@@ -6316,7 +6318,7 @@ function parsePropertyOrPrivatePropertyName(parser, context) {
|
|
|
6316
6318
|
}
|
|
6317
6319
|
return context & 1 && parser.token === 131
|
|
6318
6320
|
? parsePrivateIdentifier(parser, context, parser.tokenPos, parser.linePos, parser.colPos)
|
|
6319
|
-
: parseIdentifier(parser, context
|
|
6321
|
+
: parseIdentifier(parser, context);
|
|
6320
6322
|
}
|
|
6321
6323
|
function parseUpdateExpressionPrefixed(parser, context, inNew, isLHS, start, line, column) {
|
|
6322
6324
|
if (inNew)
|
|
@@ -6337,7 +6339,7 @@ function parseUpdateExpressionPrefixed(parser, context, inNew, isLHS, start, lin
|
|
|
6337
6339
|
prefix: true
|
|
6338
6340
|
});
|
|
6339
6341
|
}
|
|
6340
|
-
function parsePrimaryExpression(parser, context, kind, inNew, canAssign,
|
|
6342
|
+
function parsePrimaryExpression(parser, context, kind, inNew, canAssign, inGroup, isLHS, start, line, column) {
|
|
6341
6343
|
if ((parser.token & 143360) === 143360) {
|
|
6342
6344
|
switch (parser.token) {
|
|
6343
6345
|
case 209008:
|
|
@@ -6345,10 +6347,10 @@ function parsePrimaryExpression(parser, context, kind, inNew, canAssign, isPatte
|
|
|
6345
6347
|
case 241773:
|
|
6346
6348
|
return parseYieldExpression(parser, context, inGroup, canAssign, start, line, column);
|
|
6347
6349
|
case 209007:
|
|
6348
|
-
return parseAsyncExpression(parser, context, inGroup, isLHS, canAssign,
|
|
6350
|
+
return parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, inNew, start, line, column);
|
|
6349
6351
|
}
|
|
6350
6352
|
const { token, tokenValue } = parser;
|
|
6351
|
-
const expr = parseIdentifier(parser, context | 65536
|
|
6353
|
+
const expr = parseIdentifier(parser, context | 65536);
|
|
6352
6354
|
if (parser.token === 10) {
|
|
6353
6355
|
if (!isLHS)
|
|
6354
6356
|
report(parser, 0);
|
|
@@ -6427,7 +6429,7 @@ function parsePrimaryExpression(parser, context, kind, inNew, canAssign, isPatte
|
|
|
6427
6429
|
}
|
|
6428
6430
|
}
|
|
6429
6431
|
function parseImportCallOrMetaExpression(parser, context, inNew, inGroup, start, line, column) {
|
|
6430
|
-
let expr = parseIdentifier(parser, context
|
|
6432
|
+
let expr = parseIdentifier(parser, context);
|
|
6431
6433
|
if (parser.token === 67108877) {
|
|
6432
6434
|
return parseImportMetaExpression(parser, context, expr, start, line, column);
|
|
6433
6435
|
}
|
|
@@ -6447,14 +6449,14 @@ function parseImportMetaExpression(parser, context, meta, start, line, column) {
|
|
|
6447
6449
|
return finishNode(parser, context, start, line, column, {
|
|
6448
6450
|
type: 'MetaProperty',
|
|
6449
6451
|
meta,
|
|
6450
|
-
property: parseIdentifier(parser, context
|
|
6452
|
+
property: parseIdentifier(parser, context)
|
|
6451
6453
|
});
|
|
6452
6454
|
}
|
|
6453
6455
|
function parseImportExpression(parser, context, inGroup, start, line, column) {
|
|
6454
6456
|
consume(parser, context | 32768, 67174411);
|
|
6455
6457
|
if (parser.token === 14)
|
|
6456
6458
|
report(parser, 139);
|
|
6457
|
-
const source = parseExpression(parser, context, 1,
|
|
6459
|
+
const source = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6458
6460
|
consume(parser, context, 16);
|
|
6459
6461
|
return finishNode(parser, context, start, line, column, {
|
|
6460
6462
|
type: 'ImportExpression',
|
|
@@ -6543,7 +6545,7 @@ function parseTemplateElement(parser, context, cooked, raw, start, line, col, ta
|
|
|
6543
6545
|
function parseSpreadElement(parser, context, start, line, column) {
|
|
6544
6546
|
context = (context | 134217728) ^ 134217728;
|
|
6545
6547
|
consume(parser, context | 32768, 14);
|
|
6546
|
-
const argument = parseExpression(parser, context, 1, 0,
|
|
6548
|
+
const argument = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6547
6549
|
parser.assignable = 1;
|
|
6548
6550
|
return finishNode(parser, context, start, line, column, {
|
|
6549
6551
|
type: 'SpreadElement',
|
|
@@ -6562,7 +6564,7 @@ function parseArguments(parser, context, inGroup) {
|
|
|
6562
6564
|
args.push(parseSpreadElement(parser, context, parser.tokenPos, parser.linePos, parser.colPos));
|
|
6563
6565
|
}
|
|
6564
6566
|
else {
|
|
6565
|
-
args.push(parseExpression(parser, context, 1,
|
|
6567
|
+
args.push(parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos));
|
|
6566
6568
|
}
|
|
6567
6569
|
if (parser.token !== 18)
|
|
6568
6570
|
break;
|
|
@@ -6573,19 +6575,13 @@ function parseArguments(parser, context, inGroup) {
|
|
|
6573
6575
|
consume(parser, context, 16);
|
|
6574
6576
|
return args;
|
|
6575
6577
|
}
|
|
6576
|
-
function parseIdentifier(parser, context
|
|
6578
|
+
function parseIdentifier(parser, context) {
|
|
6577
6579
|
const { tokenValue, tokenPos, linePos, colPos } = parser;
|
|
6578
6580
|
nextToken(parser, context);
|
|
6579
|
-
return finishNode(parser, context, tokenPos, linePos, colPos,
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
pattern: isPattern === 1
|
|
6584
|
-
}
|
|
6585
|
-
: {
|
|
6586
|
-
type: 'Identifier',
|
|
6587
|
-
name: tokenValue
|
|
6588
|
-
});
|
|
6581
|
+
return finishNode(parser, context, tokenPos, linePos, colPos, {
|
|
6582
|
+
type: 'Identifier',
|
|
6583
|
+
name: tokenValue
|
|
6584
|
+
});
|
|
6589
6585
|
}
|
|
6590
6586
|
function parseLiteral(parser, context) {
|
|
6591
6587
|
const { tokenValue, tokenRaw, tokenPos, linePos, colPos } = parser;
|
|
@@ -6660,7 +6656,7 @@ function parseFunctionDeclaration(parser, context, scope, origin, allowGen, flag
|
|
|
6660
6656
|
}
|
|
6661
6657
|
firstRestricted = parser.token;
|
|
6662
6658
|
if (parser.token & 143360) {
|
|
6663
|
-
id = parseIdentifier(parser, context
|
|
6659
|
+
id = parseIdentifier(parser, context);
|
|
6664
6660
|
}
|
|
6665
6661
|
else {
|
|
6666
6662
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
@@ -6670,7 +6666,7 @@ function parseFunctionDeclaration(parser, context, scope, origin, allowGen, flag
|
|
|
6670
6666
|
((context | 32243712) ^ 32243712) |
|
|
6671
6667
|
67108864 |
|
|
6672
6668
|
((isAsync * 2 + isGenerator) << 21) |
|
|
6673
|
-
(isGenerator ? 0 :
|
|
6669
|
+
(isGenerator ? 0 : 268435456);
|
|
6674
6670
|
if (scope)
|
|
6675
6671
|
functionScope = addChildScope(functionScope, 512);
|
|
6676
6672
|
const params = parseFormalParametersOrFormalList(parser, context | 8388608, functionScope, 0, 1);
|
|
@@ -6697,13 +6693,13 @@ function parseFunctionExpression(parser, context, isAsync, inGroup, start, line,
|
|
|
6697
6693
|
if (scope)
|
|
6698
6694
|
scope = addChildScope(scope, 256);
|
|
6699
6695
|
firstRestricted = parser.token;
|
|
6700
|
-
id = parseIdentifier(parser, context
|
|
6696
|
+
id = parseIdentifier(parser, context);
|
|
6701
6697
|
}
|
|
6702
6698
|
context =
|
|
6703
6699
|
((context | 32243712) ^ 32243712) |
|
|
6704
6700
|
67108864 |
|
|
6705
6701
|
generatorAndAsyncFlags |
|
|
6706
|
-
(isGenerator ? 0 :
|
|
6702
|
+
(isGenerator ? 0 : 268435456);
|
|
6707
6703
|
if (scope)
|
|
6708
6704
|
scope = addChildScope(scope, 512);
|
|
6709
6705
|
const params = parseFormalParametersOrFormalList(parser, context | 8388608, scope, inGroup, 1);
|
|
@@ -6741,14 +6737,14 @@ function parseArrayExpressionOrPattern(parser, context, scope, skipInitializer,
|
|
|
6741
6737
|
let left;
|
|
6742
6738
|
const { token, tokenPos, linePos, colPos, tokenValue } = parser;
|
|
6743
6739
|
if (token & 143360) {
|
|
6744
|
-
left = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
6740
|
+
left = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
6745
6741
|
if (parser.token === 1077936157) {
|
|
6746
6742
|
if (parser.assignable & 2)
|
|
6747
6743
|
report(parser, 24);
|
|
6748
6744
|
nextToken(parser, context | 32768);
|
|
6749
6745
|
if (scope)
|
|
6750
6746
|
addVarOrBlock(parser, context, scope, tokenValue, kind, origin);
|
|
6751
|
-
const right = parseExpression(parser, context, 1,
|
|
6747
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6752
6748
|
left = finishNode(parser, context, tokenPos, linePos, colPos, isPattern
|
|
6753
6749
|
? {
|
|
6754
6750
|
type: 'AssignmentPattern',
|
|
@@ -6887,7 +6883,7 @@ function parseArrayOrObjectAssignmentPattern(parser, context, destructible, inGr
|
|
|
6887
6883
|
if (!isPattern)
|
|
6888
6884
|
reinterpretToPattern(parser, node);
|
|
6889
6885
|
const { tokenPos, linePos, colPos } = parser;
|
|
6890
|
-
const right = parseExpression(parser, context, 1,
|
|
6886
|
+
const right = parseExpression(parser, context, 1, inGroup, tokenPos, linePos, colPos);
|
|
6891
6887
|
parser.destructible =
|
|
6892
6888
|
((destructible | 64 | 8) ^
|
|
6893
6889
|
(8 | 64)) |
|
|
@@ -6913,7 +6909,7 @@ function parseSpreadOrRestElement(parser, context, scope, closingToken, kind, or
|
|
|
6913
6909
|
let { token, tokenValue, tokenPos, linePos, colPos } = parser;
|
|
6914
6910
|
if (token & (4096 | 143360)) {
|
|
6915
6911
|
parser.assignable = 1;
|
|
6916
|
-
argument = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
6912
|
+
argument = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
6917
6913
|
token = parser.token;
|
|
6918
6914
|
argument = parseMemberOrUpdateExpression(parser, context, argument, inGroup, 0, tokenPos, linePos, colPos);
|
|
6919
6915
|
if (parser.token !== 18 && parser.token !== closingToken) {
|
|
@@ -7008,7 +7004,7 @@ function parseSpreadOrRestElement(parser, context, scope, closingToken, kind, or
|
|
|
7008
7004
|
if (destructible & 16)
|
|
7009
7005
|
report(parser, 24);
|
|
7010
7006
|
reinterpretToPattern(parser, argument);
|
|
7011
|
-
const right = parseExpression(parser, context, 1,
|
|
7007
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7012
7008
|
argument = finishNode(parser, context, tokenPos, linePos, colPos, isPattern
|
|
7013
7009
|
? {
|
|
7014
7010
|
type: 'AssignmentPattern',
|
|
@@ -7080,7 +7076,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7080
7076
|
let value;
|
|
7081
7077
|
const t = parser.token;
|
|
7082
7078
|
if (parser.token & (143360 | 4096) || parser.token === 121) {
|
|
7083
|
-
key = parseIdentifier(parser, context
|
|
7079
|
+
key = parseIdentifier(parser, context);
|
|
7084
7080
|
if (parser.token === 18 || parser.token === 1074790415 || parser.token === 1077936157) {
|
|
7085
7081
|
state |= 4;
|
|
7086
7082
|
if (context & 1024 && (token & 537079808) === 537079808) {
|
|
@@ -7093,7 +7089,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7093
7089
|
addVarOrBlock(parser, context, scope, tokenValue, kind, origin);
|
|
7094
7090
|
if (consumeOpt(parser, context | 32768, 1077936157)) {
|
|
7095
7091
|
destructible |= 8;
|
|
7096
|
-
const right = parseExpression(parser, context, 1,
|
|
7092
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7097
7093
|
destructible |=
|
|
7098
7094
|
parser.destructible & 256
|
|
7099
7095
|
? 256
|
|
@@ -7102,7 +7098,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7102
7098
|
: 0;
|
|
7103
7099
|
value = finishNode(parser, context, tokenPos, linePos, colPos, {
|
|
7104
7100
|
type: 'AssignmentPattern',
|
|
7105
|
-
left: context &
|
|
7101
|
+
left: context & 536870912 ? Object.assign({}, key) : key,
|
|
7106
7102
|
right
|
|
7107
7103
|
});
|
|
7108
7104
|
}
|
|
@@ -7110,7 +7106,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7110
7106
|
destructible |=
|
|
7111
7107
|
(token === 209008 ? 128 : 0) |
|
|
7112
7108
|
(token === 121 ? 16 : 0);
|
|
7113
|
-
value = context &
|
|
7109
|
+
value = context & 536870912 ? Object.assign({}, key) : key;
|
|
7114
7110
|
}
|
|
7115
7111
|
}
|
|
7116
7112
|
else if (consumeOpt(parser, context | 32768, 21)) {
|
|
@@ -7121,7 +7117,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7121
7117
|
const tokenAfterColon = parser.token;
|
|
7122
7118
|
const valueAfterColon = parser.tokenValue;
|
|
7123
7119
|
destructible |= t === 121 ? 16 : 0;
|
|
7124
|
-
value = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
7120
|
+
value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
7125
7121
|
const { token } = parser;
|
|
7126
7122
|
value = parseMemberOrUpdateExpression(parser, context, value, inGroup, 0, tokenPos, linePos, colPos);
|
|
7127
7123
|
if (parser.token === 18 || parser.token === 1074790415) {
|
|
@@ -7242,7 +7238,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7242
7238
|
report(parser, 129);
|
|
7243
7239
|
state |= 16;
|
|
7244
7240
|
}
|
|
7245
|
-
key = parseIdentifier(parser, context
|
|
7241
|
+
key = parseIdentifier(parser, context);
|
|
7246
7242
|
state |=
|
|
7247
7243
|
token === 12402
|
|
7248
7244
|
? 256
|
|
@@ -7271,7 +7267,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7271
7267
|
state |=
|
|
7272
7268
|
8 | 1 | (token === 209007 ? 16 : 0);
|
|
7273
7269
|
if (parser.token & 143360) {
|
|
7274
|
-
key = parseIdentifier(parser, context
|
|
7270
|
+
key = parseIdentifier(parser, context);
|
|
7275
7271
|
}
|
|
7276
7272
|
else if ((parser.token & 134217728) === 134217728) {
|
|
7277
7273
|
key = parseLiteral(parser, context);
|
|
@@ -7311,7 +7307,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7311
7307
|
if (tokenValue === '__proto__')
|
|
7312
7308
|
prototypeCount++;
|
|
7313
7309
|
if (parser.token & 143360) {
|
|
7314
|
-
value = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
7310
|
+
value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
7315
7311
|
const { token, tokenValue: valueAfterColon } = parser;
|
|
7316
7312
|
value = parseMemberOrUpdateExpression(parser, context, value, inGroup, 0, tokenPos, linePos, colPos);
|
|
7317
7313
|
if (parser.token === 18 || parser.token === 1074790415) {
|
|
@@ -7412,7 +7408,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7412
7408
|
nextToken(parser, context | 32768);
|
|
7413
7409
|
const { tokenPos, linePos, colPos, tokenValue, token: tokenAfterColon } = parser;
|
|
7414
7410
|
if (parser.token & 143360) {
|
|
7415
|
-
value = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
7411
|
+
value = parsePrimaryExpression(parser, context, kind, 0, 1, inGroup, 1, tokenPos, linePos, colPos);
|
|
7416
7412
|
const { token } = parser;
|
|
7417
7413
|
value = parseMemberOrUpdateExpression(parser, context, value, inGroup, 0, tokenPos, linePos, colPos);
|
|
7418
7414
|
if ((parser.token & 4194304) === 4194304) {
|
|
@@ -7518,7 +7514,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, skipInitializer, in
|
|
|
7518
7514
|
state |= 8;
|
|
7519
7515
|
if (parser.token & 143360) {
|
|
7520
7516
|
const { token, line, index } = parser;
|
|
7521
|
-
key = parseIdentifier(parser, context
|
|
7517
|
+
key = parseIdentifier(parser, context);
|
|
7522
7518
|
state |= 1;
|
|
7523
7519
|
if (parser.token === 67174411) {
|
|
7524
7520
|
destructible |= 16;
|
|
@@ -7632,7 +7628,7 @@ function parseMethodFormals(parser, context, scope, kind, type, inGroup) {
|
|
|
7632
7628
|
if (parser.token === 1077936157) {
|
|
7633
7629
|
nextToken(parser, context | 32768);
|
|
7634
7630
|
isSimpleParameterList = 1;
|
|
7635
|
-
const right = parseExpression(parser, context, 1,
|
|
7631
|
+
const right = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7636
7632
|
left = finishNode(parser, context, tokenPos, linePos, colPos, {
|
|
7637
7633
|
type: 'AssignmentPattern',
|
|
7638
7634
|
left: left,
|
|
@@ -7659,14 +7655,14 @@ function parseMethodFormals(parser, context, scope, kind, type, inGroup) {
|
|
|
7659
7655
|
}
|
|
7660
7656
|
function parseComputedPropertyName(parser, context, inGroup) {
|
|
7661
7657
|
nextToken(parser, context | 32768);
|
|
7662
|
-
const key = parseExpression(parser, (context | 134217728) ^ 134217728, 1,
|
|
7658
|
+
const key = parseExpression(parser, (context | 134217728) ^ 134217728, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7663
7659
|
consume(parser, context, 20);
|
|
7664
7660
|
return key;
|
|
7665
7661
|
}
|
|
7666
7662
|
function parseParenthesizedExpression(parser, context, canAssign, kind, origin, start, line, column) {
|
|
7667
7663
|
parser.flags = (parser.flags | 128) ^ 128;
|
|
7668
7664
|
const { tokenPos: piStart, linePos: plStart, colPos: pcStart } = parser;
|
|
7669
|
-
nextToken(parser, context | 32768 |
|
|
7665
|
+
nextToken(parser, context | 32768 | 268435456);
|
|
7670
7666
|
const scope = context & 64 ? addChildScope(createScope(), 1024) : void 0;
|
|
7671
7667
|
context = (context | 134217728) ^ 134217728;
|
|
7672
7668
|
if (consumeOpt(parser, context, 16)) {
|
|
@@ -7685,7 +7681,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7685
7681
|
if (token & (143360 | 4096)) {
|
|
7686
7682
|
if (scope)
|
|
7687
7683
|
addBlockName(parser, context, scope, parser.tokenValue, 1, 0);
|
|
7688
|
-
expr = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
7684
|
+
expr = parsePrimaryExpression(parser, context, kind, 0, 1, 1, 1, tokenPos, linePos, colPos);
|
|
7689
7685
|
if (parser.token === 16 || parser.token === 18) {
|
|
7690
7686
|
if (parser.assignable & 2) {
|
|
7691
7687
|
destructible |= 16;
|
|
@@ -7712,8 +7708,8 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7712
7708
|
else if ((token & 2097152) === 2097152) {
|
|
7713
7709
|
expr =
|
|
7714
7710
|
token === 2162700
|
|
7715
|
-
? parseObjectLiteralOrPattern(parser, context |
|
|
7716
|
-
: parseArrayExpressionOrPattern(parser, context |
|
|
7711
|
+
? parseObjectLiteralOrPattern(parser, context | 268435456, scope, 0, 1, 0, kind, origin, tokenPos, linePos, colPos)
|
|
7712
|
+
: parseArrayExpressionOrPattern(parser, context | 268435456, scope, 0, 1, 0, kind, origin, tokenPos, linePos, colPos);
|
|
7717
7713
|
destructible |= parser.destructible;
|
|
7718
7714
|
isSimpleParameterList = 1;
|
|
7719
7715
|
parser.assignable = 2;
|
|
@@ -7740,7 +7736,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7740
7736
|
}
|
|
7741
7737
|
else {
|
|
7742
7738
|
destructible |= 16;
|
|
7743
|
-
expr = parseExpression(parser, context, 1,
|
|
7739
|
+
expr = parseExpression(parser, context, 1, 1, tokenPos, linePos, colPos);
|
|
7744
7740
|
if (isSequence && (parser.token === 16 || parser.token === 18)) {
|
|
7745
7741
|
expressions.push(expr);
|
|
7746
7742
|
}
|
|
@@ -7752,7 +7748,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7752
7748
|
}
|
|
7753
7749
|
if (isSequence) {
|
|
7754
7750
|
while (consumeOpt(parser, context | 32768, 18)) {
|
|
7755
|
-
expressions.push(parseExpression(parser, context, 1,
|
|
7751
|
+
expressions.push(parseExpression(parser, context, 1, 1, parser.tokenPos, parser.linePos, parser.colPos));
|
|
7756
7752
|
}
|
|
7757
7753
|
parser.assignable = 2;
|
|
7758
7754
|
expr = finishNode(parser, context, iStart, lStart, cStart, {
|
|
@@ -7819,7 +7815,7 @@ function parseParenthesizedExpression(parser, context, canAssign, kind, origin,
|
|
|
7819
7815
|
}
|
|
7820
7816
|
function parseIdentifierOrArrow(parser, context, start, line, column) {
|
|
7821
7817
|
const { tokenValue } = parser;
|
|
7822
|
-
const expr = parseIdentifier(parser, context
|
|
7818
|
+
const expr = parseIdentifier(parser, context);
|
|
7823
7819
|
parser.assignable = 1;
|
|
7824
7820
|
if (parser.token === 10) {
|
|
7825
7821
|
let scope = void 0;
|
|
@@ -7857,7 +7853,7 @@ function parseArrowFunctionExpression(parser, context, scope, params, isAsync, s
|
|
|
7857
7853
|
reportScopeError(scope.scopeError);
|
|
7858
7854
|
}
|
|
7859
7855
|
if (expression) {
|
|
7860
|
-
body = parseExpression(parser, context, 1, 0,
|
|
7856
|
+
body = parseExpression(parser, context & 16384 ? context | 33554432 : context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7861
7857
|
}
|
|
7862
7858
|
else {
|
|
7863
7859
|
if (scope)
|
|
@@ -7938,7 +7934,7 @@ function parseFormalParametersOrFormalList(parser, context, scope, inGroup, kind
|
|
|
7938
7934
|
if (parser.token === 1077936157) {
|
|
7939
7935
|
nextToken(parser, context | 32768);
|
|
7940
7936
|
isSimpleParameterList = 1;
|
|
7941
|
-
const right = parseExpression(parser, context, 1,
|
|
7937
|
+
const right = parseExpression(parser, context, 1, inGroup, parser.tokenPos, parser.linePos, parser.colPos);
|
|
7942
7938
|
left = finishNode(parser, context, tokenPos, linePos, colPos, {
|
|
7943
7939
|
type: 'AssignmentPattern',
|
|
7944
7940
|
left,
|
|
@@ -7964,7 +7960,7 @@ function parseMembeExpressionNoCall(parser, context, expr, inGroup, start, line,
|
|
|
7964
7960
|
const { token } = parser;
|
|
7965
7961
|
if (token & 67108864) {
|
|
7966
7962
|
if (token === 67108877) {
|
|
7967
|
-
nextToken(parser, context |
|
|
7963
|
+
nextToken(parser, context | 268435456);
|
|
7968
7964
|
parser.assignable = 1;
|
|
7969
7965
|
const property = parsePropertyOrPrivatePropertyName(parser, context);
|
|
7970
7966
|
return parseMembeExpressionNoCall(parser, context, finishNode(parser, context, start, line, column, {
|
|
@@ -8001,7 +7997,7 @@ function parseMembeExpressionNoCall(parser, context, expr, inGroup, start, line,
|
|
|
8001
7997
|
return expr;
|
|
8002
7998
|
}
|
|
8003
7999
|
function parseNewExpression(parser, context, inGroup, start, line, column) {
|
|
8004
|
-
const id = parseIdentifier(parser, context | 32768
|
|
8000
|
+
const id = parseIdentifier(parser, context | 32768);
|
|
8005
8001
|
const { tokenPos, linePos, colPos } = parser;
|
|
8006
8002
|
if (consumeOpt(parser, context, 67108877)) {
|
|
8007
8003
|
if (context & 67108864 && parser.token === 143494) {
|
|
@@ -8014,7 +8010,7 @@ function parseNewExpression(parser, context, inGroup, start, line, column) {
|
|
|
8014
8010
|
if ((parser.token & 16842752) === 16842752) {
|
|
8015
8011
|
report(parser, 63, KeywordDescTable[parser.token & 255]);
|
|
8016
8012
|
}
|
|
8017
|
-
const expr = parsePrimaryExpression(parser, context, 2, 1, 0,
|
|
8013
|
+
const expr = parsePrimaryExpression(parser, context, 2, 1, 0, inGroup, 1, tokenPos, linePos, colPos);
|
|
8018
8014
|
context = (context | 134217728) ^ 134217728;
|
|
8019
8015
|
if (parser.token === 67108991)
|
|
8020
8016
|
report(parser, 163);
|
|
@@ -8027,7 +8023,7 @@ function parseNewExpression(parser, context, inGroup, start, line, column) {
|
|
|
8027
8023
|
});
|
|
8028
8024
|
}
|
|
8029
8025
|
function parseMetaProperty(parser, context, meta, start, line, column) {
|
|
8030
|
-
const property = parseIdentifier(parser, context
|
|
8026
|
+
const property = parseIdentifier(parser, context);
|
|
8031
8027
|
return finishNode(parser, context, start, line, column, {
|
|
8032
8028
|
type: 'MetaProperty',
|
|
8033
8029
|
meta,
|
|
@@ -8043,7 +8039,7 @@ function parseAsyncArrowAfterIdent(parser, context, canAssign, start, line, colu
|
|
|
8043
8039
|
if ((parser.token & 537079808) === 537079808) {
|
|
8044
8040
|
parser.flags |= 512;
|
|
8045
8041
|
}
|
|
8046
|
-
return parseArrowFromIdentifier(parser, context, parser.tokenValue, parseIdentifier(parser, context
|
|
8042
|
+
return parseArrowFromIdentifier(parser, context, parser.tokenValue, parseIdentifier(parser, context), 0, canAssign, 1, start, line, column);
|
|
8047
8043
|
}
|
|
8048
8044
|
function parseAsyncArrowOrCallExpression(parser, context, callee, canAssign, kind, origin, flags, start, line, column) {
|
|
8049
8045
|
nextToken(parser, context | 32768);
|
|
@@ -8073,7 +8069,7 @@ function parseAsyncArrowOrCallExpression(parser, context, callee, canAssign, kin
|
|
|
8073
8069
|
if (token & (143360 | 4096)) {
|
|
8074
8070
|
if (scope)
|
|
8075
8071
|
addBlockName(parser, context, scope, parser.tokenValue, kind, 0);
|
|
8076
|
-
expr = parsePrimaryExpression(parser, context, kind, 0, 1,
|
|
8072
|
+
expr = parsePrimaryExpression(parser, context, kind, 0, 1, 1, 1, tokenPos, linePos, colPos);
|
|
8077
8073
|
if (parser.token === 16 || parser.token === 18) {
|
|
8078
8074
|
if (parser.assignable & 2) {
|
|
8079
8075
|
destructible |= 16;
|
|
@@ -8125,11 +8121,11 @@ function parseAsyncArrowOrCallExpression(parser, context, callee, canAssign, kin
|
|
|
8125
8121
|
isSimpleParameterList = 1;
|
|
8126
8122
|
}
|
|
8127
8123
|
else {
|
|
8128
|
-
expr = parseExpression(parser, context, 1, 0,
|
|
8124
|
+
expr = parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos);
|
|
8129
8125
|
destructible = parser.assignable;
|
|
8130
8126
|
params.push(expr);
|
|
8131
8127
|
while (consumeOpt(parser, context | 32768, 18)) {
|
|
8132
|
-
params.push(parseExpression(parser, context, 1, 0,
|
|
8128
|
+
params.push(parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos));
|
|
8133
8129
|
}
|
|
8134
8130
|
destructible |= parser.assignable;
|
|
8135
8131
|
consume(parser, context, 16);
|
|
@@ -8224,7 +8220,7 @@ function parseClassDeclaration(parser, context, scope, flags, start, line, colum
|
|
|
8224
8220
|
}
|
|
8225
8221
|
}
|
|
8226
8222
|
}
|
|
8227
|
-
id = parseIdentifier(parser, context
|
|
8223
|
+
id = parseIdentifier(parser, context);
|
|
8228
8224
|
}
|
|
8229
8225
|
else {
|
|
8230
8226
|
if ((flags & 1) === 0)
|
|
@@ -8271,7 +8267,7 @@ function parseClassExpression(parser, context, inGroup, start, line, column) {
|
|
|
8271
8267
|
if ((parser.token & 537079808) === 537079808) {
|
|
8272
8268
|
report(parser, 116);
|
|
8273
8269
|
}
|
|
8274
|
-
id = parseIdentifier(parser, context
|
|
8270
|
+
id = parseIdentifier(parser, context);
|
|
8275
8271
|
}
|
|
8276
8272
|
let inheritedContext = context;
|
|
8277
8273
|
if (consumeOpt(parser, context | 32768, 20567)) {
|
|
@@ -8309,7 +8305,7 @@ function parseDecorators(parser, context) {
|
|
|
8309
8305
|
}
|
|
8310
8306
|
function parseDecoratorList(parser, context, start, line, column) {
|
|
8311
8307
|
nextToken(parser, context | 32768);
|
|
8312
|
-
let expression = parsePrimaryExpression(parser, context, 2, 0, 1, 0,
|
|
8308
|
+
let expression = parsePrimaryExpression(parser, context, 2, 0, 1, 0, 1, start, line, column);
|
|
8313
8309
|
expression = parseMemberOrUpdateExpression(parser, context, expression, 0, 0, start, line, column);
|
|
8314
8310
|
return finishNode(parser, context, start, line, column, {
|
|
8315
8311
|
type: 'Decorator',
|
|
@@ -8352,7 +8348,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8352
8348
|
let key = null;
|
|
8353
8349
|
const { token, tokenPos, linePos, colPos } = parser;
|
|
8354
8350
|
if (token & (143360 | 36864)) {
|
|
8355
|
-
key = parseIdentifier(parser, context
|
|
8351
|
+
key = parseIdentifier(parser, context);
|
|
8356
8352
|
switch (token) {
|
|
8357
8353
|
case 36972:
|
|
8358
8354
|
if (!isStatic &&
|
|
@@ -8410,7 +8406,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8410
8406
|
return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
|
|
8411
8407
|
}
|
|
8412
8408
|
else if (token === 122) {
|
|
8413
|
-
key = parseIdentifier(parser, context
|
|
8409
|
+
key = parseIdentifier(parser, context);
|
|
8414
8410
|
if (parser.token !== 67174411)
|
|
8415
8411
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
8416
8412
|
}
|
|
@@ -8419,7 +8415,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8419
8415
|
}
|
|
8420
8416
|
if (kind & (8 | 16 | 768)) {
|
|
8421
8417
|
if (parser.token & 143360) {
|
|
8422
|
-
key = parseIdentifier(parser, context
|
|
8418
|
+
key = parseIdentifier(parser, context);
|
|
8423
8419
|
}
|
|
8424
8420
|
else if ((parser.token & 134217728) === 134217728) {
|
|
8425
8421
|
key = parseLiteral(parser, context);
|
|
@@ -8429,7 +8425,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
|
|
|
8429
8425
|
key = parseComputedPropertyName(parser, context, 0);
|
|
8430
8426
|
}
|
|
8431
8427
|
else if (parser.token === 122) {
|
|
8432
|
-
key = parseIdentifier(parser, context
|
|
8428
|
+
key = parseIdentifier(parser, context);
|
|
8433
8429
|
}
|
|
8434
8430
|
else if (context & 1 && parser.token === 131) {
|
|
8435
8431
|
kind |= 4096;
|
|
@@ -8517,7 +8513,14 @@ function parsePropertyDefinition(parser, context, key, state, decorators, start,
|
|
|
8517
8513
|
const { tokenPos, linePos, colPos } = parser;
|
|
8518
8514
|
if (parser.token === 537079928)
|
|
8519
8515
|
report(parser, 116);
|
|
8520
|
-
|
|
8516
|
+
const modifierFlags = (state & 64) === 0
|
|
8517
|
+
? 31981568
|
|
8518
|
+
: 14680064;
|
|
8519
|
+
context =
|
|
8520
|
+
((context | modifierFlags) ^ modifierFlags) |
|
|
8521
|
+
((state & 88) << 18) |
|
|
8522
|
+
100925440;
|
|
8523
|
+
value = parsePrimaryExpression(parser, context | 16384, 2, 0, 1, 0, 1, tokenPos, linePos, colPos);
|
|
8521
8524
|
if ((parser.token & 1073741824) !== 1073741824 ||
|
|
8522
8525
|
(parser.token & 4194304) === 4194304) {
|
|
8523
8526
|
value = parseMemberOrUpdateExpression(parser, context | 16384, value, 0, 0, tokenPos, linePos, colPos);
|
|
@@ -8725,7 +8728,7 @@ function parseJSXAttributes(parser, context) {
|
|
|
8725
8728
|
function parseJSXSpreadAttribute(parser, context, start, line, column) {
|
|
8726
8729
|
nextToken(parser, context);
|
|
8727
8730
|
consume(parser, context, 14);
|
|
8728
|
-
const expression = parseExpression(parser, context, 1, 0,
|
|
8731
|
+
const expression = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
8729
8732
|
consume(parser, context, 1074790415);
|
|
8730
8733
|
return finishNode(parser, context, start, line, column, {
|
|
8731
8734
|
type: 'JSXSpreadAttribute',
|
|
@@ -8785,7 +8788,7 @@ function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start,
|
|
|
8785
8788
|
expression = parseJSXEmptyExpression(parser, context, parser.startPos, parser.startLine, parser.startColumn);
|
|
8786
8789
|
}
|
|
8787
8790
|
else {
|
|
8788
|
-
expression = parseExpression(parser, context, 1, 0,
|
|
8791
|
+
expression = parseExpression(parser, context, 1, 0, tokenPos, linePos, colPos);
|
|
8789
8792
|
}
|
|
8790
8793
|
if (inJSXChild) {
|
|
8791
8794
|
consume(parser, context, 1074790415);
|
|
@@ -8800,7 +8803,7 @@ function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start,
|
|
|
8800
8803
|
}
|
|
8801
8804
|
function parseJSXSpreadChild(parser, context, start, line, column) {
|
|
8802
8805
|
consume(parser, context, 14);
|
|
8803
|
-
const expression = parseExpression(parser, context, 1, 0,
|
|
8806
|
+
const expression = parseExpression(parser, context, 1, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
8804
8807
|
consume(parser, context, 1074790415);
|
|
8805
8808
|
return finishNode(parser, context, start, line, column, {
|
|
8806
8809
|
type: 'JSXSpreadChild',
|
|
@@ -8828,7 +8831,7 @@ var estree = /*#__PURE__*/Object.freeze({
|
|
|
8828
8831
|
__proto__: null
|
|
8829
8832
|
});
|
|
8830
8833
|
|
|
8831
|
-
var version$1 = "4.4.
|
|
8834
|
+
var version$1 = "4.4.4";
|
|
8832
8835
|
|
|
8833
8836
|
const version = version$1;
|
|
8834
8837
|
function parseScript(source, options) {
|