meriyah 7.4.1 → 7.4.2
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 +31 -0
- package/dist/meriyah.cjs +91 -55
- package/dist/meriyah.min.mjs +1 -1
- package/dist/meriyah.mjs +91 -55
- package/dist/meriyah.umd.js +91 -55
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/types/parser/private-scope.d.ts +0 -1
- package/package.json +1 -1
package/dist/meriyah.umd.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.meriyah = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var version$1 = "7.4.
|
|
7
|
+
var version$1 = "7.4.2";
|
|
8
8
|
var packageJson = {
|
|
9
9
|
version: version$1};
|
|
10
10
|
|
|
@@ -1892,7 +1892,9 @@
|
|
|
1892
1892
|
}
|
|
1893
1893
|
if (ch === 33) {
|
|
1894
1894
|
const index = parser.index + 1;
|
|
1895
|
-
if (
|
|
1895
|
+
if (parser.options.webcompat &&
|
|
1896
|
+
!(context & 2) &&
|
|
1897
|
+
index + 1 < parser.end &&
|
|
1896
1898
|
source.charCodeAt(index) === 45 &&
|
|
1897
1899
|
source.charCodeAt(index + 1) == 45) {
|
|
1898
1900
|
parser.column += 3;
|
|
@@ -1974,7 +1976,10 @@
|
|
|
1974
1976
|
const ch = parser.currentChar;
|
|
1975
1977
|
if (ch === 45) {
|
|
1976
1978
|
advanceChar(parser);
|
|
1977
|
-
if (
|
|
1979
|
+
if (parser.currentChar === 62 &&
|
|
1980
|
+
(state & 1 ||
|
|
1981
|
+
isStartOfLine ||
|
|
1982
|
+
(parser.getToken() === 1048576 && parser.line > 1))) {
|
|
1978
1983
|
if (!parser.options.webcompat)
|
|
1979
1984
|
parser.report(114);
|
|
1980
1985
|
advanceChar(parser);
|
|
@@ -2246,10 +2251,10 @@
|
|
|
2246
2251
|
if ((t & 20480) === 20480) {
|
|
2247
2252
|
parser.report(102);
|
|
2248
2253
|
}
|
|
2249
|
-
if (context & (2048 | 2) && t === 209006) {
|
|
2254
|
+
if (context & (2048 | 2) && (t & 2147483647) === 209006) {
|
|
2250
2255
|
parser.report(112);
|
|
2251
2256
|
}
|
|
2252
|
-
if (context & (1024 | 1) && t === 241771) {
|
|
2257
|
+
if (context & (1024 | 1) && (t & 2147483647) === 241771) {
|
|
2253
2258
|
parser.report(97, 'yield');
|
|
2254
2259
|
}
|
|
2255
2260
|
}
|
|
@@ -2309,7 +2314,8 @@
|
|
|
2309
2314
|
return false;
|
|
2310
2315
|
if (context & 1024 && t === 241771)
|
|
2311
2316
|
return false;
|
|
2312
|
-
|
|
2317
|
+
if (context & 1)
|
|
2318
|
+
return (t & 12288) === 12288;
|
|
2313
2319
|
}
|
|
2314
2320
|
return (t & 12288) === 12288 || (t & 36864) === 36864;
|
|
2315
2321
|
}
|
|
@@ -2763,12 +2769,14 @@
|
|
|
2763
2769
|
this.refs[name] ??= [];
|
|
2764
2770
|
this.refs[name].push(this.parser.tokenStart);
|
|
2765
2771
|
}
|
|
2766
|
-
isPrivateIdentifierDefined(name) {
|
|
2767
|
-
return this.hasPrivateIdentifier(name) || Boolean(this.parent?.isPrivateIdentifierDefined(name));
|
|
2768
|
-
}
|
|
2769
2772
|
validatePrivateIdentifierRefs() {
|
|
2770
2773
|
for (const name in this.refs) {
|
|
2771
|
-
if (
|
|
2774
|
+
if (this.hasPrivateIdentifier(name))
|
|
2775
|
+
continue;
|
|
2776
|
+
if (this.parent) {
|
|
2777
|
+
(this.parent.refs[name] ??= []).push(...this.refs[name]);
|
|
2778
|
+
}
|
|
2779
|
+
else {
|
|
2772
2780
|
const { index, line, column } = this.refs[name][0];
|
|
2773
2781
|
throw new ParseError({ index, line, column }, { index: index + name.length, line, column: column + name.length }, 4, name);
|
|
2774
2782
|
}
|
|
@@ -3189,7 +3197,7 @@
|
|
|
3189
3197
|
case 86090:
|
|
3190
3198
|
return parseLexicalDeclaration(parser, context, scope, privateScope, 16);
|
|
3191
3199
|
case 241737:
|
|
3192
|
-
return parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin);
|
|
3200
|
+
return parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, labels, origin);
|
|
3193
3201
|
case 209013:
|
|
3194
3202
|
return parseUsingDeclarationOrExpressionStatement(parser, context, scope, privateScope, labels, origin);
|
|
3195
3203
|
case 209006:
|
|
@@ -3211,7 +3219,7 @@
|
|
|
3211
3219
|
parser.report(103, 'import');
|
|
3212
3220
|
}
|
|
3213
3221
|
case 209005:
|
|
3214
|
-
return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, labels, 1, origin);
|
|
3222
|
+
return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, labels, 1, 1, origin);
|
|
3215
3223
|
default:
|
|
3216
3224
|
return parseStatement(parser, context, scope, privateScope, labels, 1, origin);
|
|
3217
3225
|
}
|
|
@@ -3249,7 +3257,7 @@
|
|
|
3249
3257
|
case 20560:
|
|
3250
3258
|
return parseDebuggerStatement(parser, context);
|
|
3251
3259
|
case 209005:
|
|
3252
|
-
return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, labels, 0, origin);
|
|
3260
|
+
return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, labels, 0, allowFuncDecl, origin);
|
|
3253
3261
|
case 20557:
|
|
3254
3262
|
parser.report(164);
|
|
3255
3263
|
case 20566:
|
|
@@ -3279,7 +3287,7 @@
|
|
|
3279
3287
|
parser.report(84);
|
|
3280
3288
|
break;
|
|
3281
3289
|
default:
|
|
3282
|
-
expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, parser.tokenStart,
|
|
3290
|
+
expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, parser.tokenStart, 1, 1);
|
|
3283
3291
|
}
|
|
3284
3292
|
return finishExpressionOrLabelledStatement(parser, context, scope, privateScope, labels, allowFuncDecl, expr, token, tokenValue, tokenStart, origin);
|
|
3285
3293
|
}
|
|
@@ -3343,17 +3351,17 @@
|
|
|
3343
3351
|
body,
|
|
3344
3352
|
}, start);
|
|
3345
3353
|
}
|
|
3346
|
-
function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, labels, allowFuncDecl, origin) {
|
|
3354
|
+
function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, labels, allowAsyncFuncDecl, allowFuncDecl, origin) {
|
|
3347
3355
|
const { tokenValue, tokenStart: start } = parser;
|
|
3348
3356
|
const token = parser.getToken();
|
|
3349
3357
|
let expr = parseIdentifier(parser, context);
|
|
3350
3358
|
if (parser.getToken() === 21) {
|
|
3351
|
-
return parseLabelledStatement(parser, context, scope, privateScope, labels, tokenValue, expr, token,
|
|
3359
|
+
return parseLabelledStatement(parser, context, scope, privateScope, labels, tokenValue, expr, token, allowFuncDecl, start, origin);
|
|
3352
3360
|
}
|
|
3353
3361
|
const asyncNewLine = parser.flags & 1;
|
|
3354
3362
|
if (!asyncNewLine) {
|
|
3355
3363
|
if (parser.getToken() === 86104) {
|
|
3356
|
-
if (!
|
|
3364
|
+
if (!allowAsyncFuncDecl)
|
|
3357
3365
|
parser.report(125);
|
|
3358
3366
|
return parseFunctionDeclaration(parser, context, scope, privateScope, 1, 0, 1, start, origin);
|
|
3359
3367
|
}
|
|
@@ -3375,7 +3383,9 @@
|
|
|
3375
3383
|
}
|
|
3376
3384
|
expr = parseArrowFromIdentifier(parser, context | 2048, privateScope, parser.tokenValue, expr, 0, 1, 0, start);
|
|
3377
3385
|
}
|
|
3378
|
-
|
|
3386
|
+
else {
|
|
3387
|
+
parser.assignable = 1;
|
|
3388
|
+
}
|
|
3379
3389
|
}
|
|
3380
3390
|
expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start);
|
|
3381
3391
|
expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, start, expr);
|
|
@@ -3630,7 +3640,12 @@
|
|
|
3630
3640
|
}
|
|
3631
3641
|
function parseStaticBlock(parser, context, scope, privateScope, start) {
|
|
3632
3642
|
scope = scope?.createChildScope();
|
|
3633
|
-
const ctorContext = 512 |
|
|
3643
|
+
const ctorContext = 512 |
|
|
3644
|
+
4096 |
|
|
3645
|
+
1024 |
|
|
3646
|
+
4 |
|
|
3647
|
+
128 |
|
|
3648
|
+
32768;
|
|
3634
3649
|
context =
|
|
3635
3650
|
((context | ctorContext) ^ ctorContext) |
|
|
3636
3651
|
256 |
|
|
@@ -3654,7 +3669,7 @@
|
|
|
3654
3669
|
test,
|
|
3655
3670
|
}, start);
|
|
3656
3671
|
}
|
|
3657
|
-
function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin) {
|
|
3672
|
+
function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, labels, origin) {
|
|
3658
3673
|
const { tokenValue, tokenStart, currentLocation } = parser;
|
|
3659
3674
|
const token = parser.getToken();
|
|
3660
3675
|
let expr = parseIdentifier(parser, context);
|
|
@@ -3672,7 +3687,7 @@
|
|
|
3672
3687
|
if (context & 1)
|
|
3673
3688
|
parser.report(85);
|
|
3674
3689
|
if (parser.getToken() === 21) {
|
|
3675
|
-
return parseLabelledStatement(parser, context, scope, privateScope,
|
|
3690
|
+
return parseLabelledStatement(parser, context, scope, privateScope, labels, tokenValue, expr, token, 1, tokenStart, origin);
|
|
3676
3691
|
}
|
|
3677
3692
|
if (parser.getToken() === 10) {
|
|
3678
3693
|
let scope = void 0;
|
|
@@ -3855,6 +3870,9 @@
|
|
|
3855
3870
|
function parseForStatement(parser, context, scope, privateScope, labels) {
|
|
3856
3871
|
const start = parser.tokenStart;
|
|
3857
3872
|
nextToken(parser, context);
|
|
3873
|
+
if (context & 524288 && parser.getToken() === 209006) {
|
|
3874
|
+
parser.report(179);
|
|
3875
|
+
}
|
|
3858
3876
|
const forAwait = ((context & 2048) > 0 || ((context & 2) > 0 && (context & 8) > 0)) &&
|
|
3859
3877
|
consumeOpt(parser, context, 209006);
|
|
3860
3878
|
consume(parser, context | 32, 67174411);
|
|
@@ -4334,7 +4352,9 @@
|
|
|
4334
4352
|
}
|
|
4335
4353
|
function parseImportCallDeclaration(parser, context, privateScope, start) {
|
|
4336
4354
|
let expr = parseImportExpression(parser, context, privateScope, 0, start);
|
|
4355
|
+
parser.assignable = 2;
|
|
4337
4356
|
expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start);
|
|
4357
|
+
expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, start, expr);
|
|
4338
4358
|
if (parser.getToken() === 18) {
|
|
4339
4359
|
expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr);
|
|
4340
4360
|
}
|
|
@@ -4742,9 +4762,9 @@
|
|
|
4742
4762
|
}
|
|
4743
4763
|
if (context & 1)
|
|
4744
4764
|
parser.report(97, 'yield');
|
|
4745
|
-
return parseIdentifierOrArrow(parser, context, privateScope);
|
|
4765
|
+
return parseIdentifierOrArrow(parser, context, privateScope, 0, canAssign);
|
|
4746
4766
|
}
|
|
4747
|
-
function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start) {
|
|
4767
|
+
function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, canAssign, start) {
|
|
4748
4768
|
if (inGroup) {
|
|
4749
4769
|
if ((parser.destructible & 128) === 0) {
|
|
4750
4770
|
parser.firstAwaitLocation ??= { start, end: parser.currentLocation };
|
|
@@ -4755,10 +4775,11 @@
|
|
|
4755
4775
|
parser.report(179);
|
|
4756
4776
|
const isEscaped = (parser.getToken() & -2147483648) !== 0;
|
|
4757
4777
|
const allowRegExp = !isEscaped && context & (2048 | 2) ? 1 : 0;
|
|
4758
|
-
const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope, allowRegExp);
|
|
4778
|
+
const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope, allowRegExp, canAssign);
|
|
4759
4779
|
const isIdentifier = isEscaped ||
|
|
4760
4780
|
possibleIdentifierOrArrowFunc.type === 'ArrowFunctionExpression' ||
|
|
4761
|
-
(parser.getToken() & 65536) === 0
|
|
4781
|
+
((parser.getToken() & 65536) === 0 &&
|
|
4782
|
+
(parser.getToken() & 36864) !== 36864);
|
|
4762
4783
|
if (isIdentifier) {
|
|
4763
4784
|
if (context & 2048)
|
|
4764
4785
|
throw new ParseError(start, parser.startPosition, 178);
|
|
@@ -4878,8 +4899,11 @@
|
|
|
4878
4899
|
return parseMemberOrUpdateExpression(parser, context, privateScope, expression, inGroup, 0, start);
|
|
4879
4900
|
}
|
|
4880
4901
|
function parseUpdateExpression(parser, context, expr, start) {
|
|
4881
|
-
if (parser.assignable & 2
|
|
4902
|
+
if (parser.assignable & 2 ||
|
|
4903
|
+
expr.type === 'ArrayExpression' ||
|
|
4904
|
+
expr.type === 'ObjectExpression') {
|
|
4882
4905
|
parser.report(55);
|
|
4906
|
+
}
|
|
4883
4907
|
const token = parser.getToken();
|
|
4884
4908
|
nextToken(parser, context);
|
|
4885
4909
|
parser.assignable = 2;
|
|
@@ -4958,7 +4982,7 @@
|
|
|
4958
4982
|
parser.flags = (parser.flags | 2048) ^ 2048;
|
|
4959
4983
|
}
|
|
4960
4984
|
const args = parseArguments(parser, context, privateScope, inGroup);
|
|
4961
|
-
if (!(context & 1) && parser.options.webcompat) {
|
|
4985
|
+
if (!restoreHasOptionalChaining && !(context & 1) && parser.options.webcompat) {
|
|
4962
4986
|
parser.assignable = 4;
|
|
4963
4987
|
}
|
|
4964
4988
|
else {
|
|
@@ -5031,12 +5055,7 @@
|
|
|
5031
5055
|
}
|
|
5032
5056
|
else if (parser.getToken() === 67174411) {
|
|
5033
5057
|
const args = parseArguments(parser, context, privateScope, 0);
|
|
5034
|
-
|
|
5035
|
-
parser.assignable = 4;
|
|
5036
|
-
}
|
|
5037
|
-
else {
|
|
5038
|
-
parser.assignable = 2;
|
|
5039
|
-
}
|
|
5058
|
+
parser.assignable = 2;
|
|
5040
5059
|
node = parser.finishNode({
|
|
5041
5060
|
type: 'CallExpression',
|
|
5042
5061
|
callee: expr,
|
|
@@ -5095,7 +5114,7 @@
|
|
|
5095
5114
|
switch (parser.getToken()) {
|
|
5096
5115
|
case 209006:
|
|
5097
5116
|
case 209006 | -2147483648:
|
|
5098
|
-
return parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start);
|
|
5117
|
+
return parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, canAssign, start);
|
|
5099
5118
|
case 241771:
|
|
5100
5119
|
return parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start);
|
|
5101
5120
|
case 209005:
|
|
@@ -5116,8 +5135,9 @@
|
|
|
5116
5135
|
if (context & 16 &&
|
|
5117
5136
|
!(context & 32768) &&
|
|
5118
5137
|
!(context & 8192) &&
|
|
5119
|
-
parser.tokenValue === 'arguments'
|
|
5120
|
-
parser.
|
|
5138
|
+
parser.tokenValue === 'arguments' &&
|
|
5139
|
+
!(origin & 1 && parser.getToken() === 21))
|
|
5140
|
+
throw new ParseError(start, parser.startPosition, 132);
|
|
5121
5141
|
if ((token & 255) === (241737 & 255)) {
|
|
5122
5142
|
if (context & 1)
|
|
5123
5143
|
parser.report(115);
|
|
@@ -5152,7 +5172,7 @@
|
|
|
5152
5172
|
case 69271571:
|
|
5153
5173
|
return parseArrayLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup);
|
|
5154
5174
|
case 67174411:
|
|
5155
|
-
return parseParenthesizedExpression(parser, context
|
|
5175
|
+
return parseParenthesizedExpression(parser, context, privateScope, canAssign, 1, start, origin);
|
|
5156
5176
|
case 86021:
|
|
5157
5177
|
case 86022:
|
|
5158
5178
|
case 86023:
|
|
@@ -5193,8 +5213,9 @@
|
|
|
5193
5213
|
if (parser.options.jsx)
|
|
5194
5214
|
return parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart);
|
|
5195
5215
|
default:
|
|
5196
|
-
if (isValidIdentifier(context, parser.getToken()))
|
|
5197
|
-
return parseIdentifierOrArrow(parser, context, privateScope);
|
|
5216
|
+
if (isValidIdentifier(context, parser.getToken())) {
|
|
5217
|
+
return parseIdentifierOrArrow(parser, context, privateScope, 0, canAssign);
|
|
5218
|
+
}
|
|
5198
5219
|
parser.report(30, KeywordDescTable[parser.getToken() & 255]);
|
|
5199
5220
|
}
|
|
5200
5221
|
}
|
|
@@ -5595,6 +5616,8 @@
|
|
|
5595
5616
|
if (parser.destructible & 8) {
|
|
5596
5617
|
parser.report(62);
|
|
5597
5618
|
}
|
|
5619
|
+
if (expr.type === 'ArrayExpression')
|
|
5620
|
+
parser.assignable = 2;
|
|
5598
5621
|
return expr;
|
|
5599
5622
|
}
|
|
5600
5623
|
function parseArrayExpressionOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin = 0) {
|
|
@@ -5706,8 +5729,10 @@
|
|
|
5706
5729
|
parser.report(30, KeywordDescTable[parser.getToken() & 255]);
|
|
5707
5730
|
}
|
|
5708
5731
|
else {
|
|
5709
|
-
left = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1);
|
|
5732
|
+
left = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1, context & 131072 ? 0 : 1);
|
|
5710
5733
|
if (parser.getToken() !== 18 && parser.getToken() !== 20) {
|
|
5734
|
+
if (parser.getToken() !== 1077936155)
|
|
5735
|
+
destructible |= 16;
|
|
5711
5736
|
left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left);
|
|
5712
5737
|
if ((kind & (2 | 1)) === 0 && token === 67174411)
|
|
5713
5738
|
destructible |= 16;
|
|
@@ -5839,7 +5864,7 @@
|
|
|
5839
5864
|
}
|
|
5840
5865
|
else {
|
|
5841
5866
|
destructible |= 32;
|
|
5842
|
-
argument = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1);
|
|
5867
|
+
argument = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1, context & 131072 ? 0 : 1);
|
|
5843
5868
|
const token = parser.getToken();
|
|
5844
5869
|
if (token === 1077936155) {
|
|
5845
5870
|
if (parser.assignable & 2)
|
|
@@ -5915,7 +5940,8 @@
|
|
|
5915
5940
|
let scope = parser.createScopeIfLexical(256);
|
|
5916
5941
|
const params = parseMethodFormals(parser, (context | 8192) & -524289, scope, privateScope, kind, 1, inGroup);
|
|
5917
5942
|
scope = scope?.createChildScope(64);
|
|
5918
|
-
const body = parseFunctionBody(parser, (context &
|
|
5943
|
+
const body = parseFunctionBody(parser, (context &
|
|
5944
|
+
-655501) |
|
|
5919
5945
|
32768 |
|
|
5920
5946
|
4096, scope, privateScope, void 0, scope?.parent);
|
|
5921
5947
|
return parser.finishNode({
|
|
@@ -5935,6 +5961,8 @@
|
|
|
5935
5961
|
if (parser.destructible & 8) {
|
|
5936
5962
|
parser.report(62);
|
|
5937
5963
|
}
|
|
5964
|
+
if (expr.type === 'ObjectExpression')
|
|
5965
|
+
parser.assignable = 2;
|
|
5938
5966
|
return expr;
|
|
5939
5967
|
}
|
|
5940
5968
|
function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin = 0) {
|
|
@@ -5964,6 +5992,11 @@
|
|
|
5964
5992
|
parser.getToken() === 1074790415 ||
|
|
5965
5993
|
parser.getToken() === 1077936155) {
|
|
5966
5994
|
state |= 4;
|
|
5995
|
+
if (context & 16 &&
|
|
5996
|
+
!(context & 32768) &&
|
|
5997
|
+
!(context & 8192) &&
|
|
5998
|
+
tokenValue === 'arguments')
|
|
5999
|
+
throw new ParseError(tokenStart, currentLocation, 132);
|
|
5967
6000
|
if (context & 1 && (token & 537079808) === 537079808) {
|
|
5968
6001
|
destructible |= 16;
|
|
5969
6002
|
}
|
|
@@ -6077,7 +6110,7 @@
|
|
|
6077
6110
|
}
|
|
6078
6111
|
}
|
|
6079
6112
|
else {
|
|
6080
|
-
value = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1);
|
|
6113
|
+
value = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1, context & 131072 ? 0 : 1);
|
|
6081
6114
|
destructible |=
|
|
6082
6115
|
parser.assignable & 1
|
|
6083
6116
|
? 32
|
|
@@ -6258,7 +6291,7 @@
|
|
|
6258
6291
|
}
|
|
6259
6292
|
}
|
|
6260
6293
|
else {
|
|
6261
|
-
value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1);
|
|
6294
|
+
value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1, context & 131072 ? 0 : 1);
|
|
6262
6295
|
destructible |=
|
|
6263
6296
|
parser.assignable & 1
|
|
6264
6297
|
? 32
|
|
@@ -6371,7 +6404,7 @@
|
|
|
6371
6404
|
}
|
|
6372
6405
|
}
|
|
6373
6406
|
else {
|
|
6374
|
-
value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1);
|
|
6407
|
+
value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1, context & 131072 ? 0 : 1);
|
|
6375
6408
|
destructible |=
|
|
6376
6409
|
parser.assignable & 1
|
|
6377
6410
|
? 32
|
|
@@ -6504,7 +6537,7 @@
|
|
|
6504
6537
|
parser.flags |= 512;
|
|
6505
6538
|
}
|
|
6506
6539
|
}
|
|
6507
|
-
left = parseAndClassifyIdentifier(parser, context, scope,
|
|
6540
|
+
left = parseAndClassifyIdentifier(parser, context, scope, type);
|
|
6508
6541
|
}
|
|
6509
6542
|
else {
|
|
6510
6543
|
if (parser.getToken() === 2162700) {
|
|
@@ -6658,7 +6691,7 @@
|
|
|
6658
6691
|
expressions: expressions,
|
|
6659
6692
|
}, tokenAfterParenthesesStart);
|
|
6660
6693
|
}
|
|
6661
|
-
consume(parser, context, 16);
|
|
6694
|
+
consume(parser, context | 64, 16);
|
|
6662
6695
|
parser.destructible = destructible | previousAwaitYield;
|
|
6663
6696
|
if (previousFirstAwaitLocation) {
|
|
6664
6697
|
parser.firstAwaitLocation = previousFirstAwaitLocation;
|
|
@@ -6694,7 +6727,7 @@
|
|
|
6694
6727
|
expressions: expressions,
|
|
6695
6728
|
}, tokenAfterParenthesesStart);
|
|
6696
6729
|
}
|
|
6697
|
-
consume(parser, context, 16);
|
|
6730
|
+
consume(parser, context | 64, 16);
|
|
6698
6731
|
if (destructible & 16 && destructible & 8)
|
|
6699
6732
|
parser.report(153);
|
|
6700
6733
|
destructible |=
|
|
@@ -6749,7 +6782,7 @@
|
|
|
6749
6782
|
}, parenthesesStart)
|
|
6750
6783
|
: expr;
|
|
6751
6784
|
}
|
|
6752
|
-
function parseIdentifierOrArrow(parser, context, privateScope, allowRegExp = 0) {
|
|
6785
|
+
function parseIdentifierOrArrow(parser, context, privateScope, allowRegExp = 0, canAssign = 1) {
|
|
6753
6786
|
const { tokenValue, tokenStart, currentLocation } = parser;
|
|
6754
6787
|
let isNonSimpleParameterList = 0;
|
|
6755
6788
|
let hasStrictReserved = 0;
|
|
@@ -6762,6 +6795,8 @@
|
|
|
6762
6795
|
const expr = parseIdentifier(parser, context, allowRegExp);
|
|
6763
6796
|
parser.assignable = 1;
|
|
6764
6797
|
if (parser.getToken() === 10) {
|
|
6798
|
+
if (!canAssign)
|
|
6799
|
+
parser.report(57);
|
|
6765
6800
|
const scope = parser.options.lexical
|
|
6766
6801
|
? createArrowHeadParsingScope(parser, context, tokenValue, tokenStart, currentLocation)
|
|
6767
6802
|
: undefined;
|
|
@@ -6795,7 +6830,7 @@
|
|
|
6795
6830
|
if (parser.flags & 1)
|
|
6796
6831
|
parser.report(48);
|
|
6797
6832
|
consume(parser, context | 32, 10);
|
|
6798
|
-
const modifierFlags = 1024 | 2048 | 8192 | 524288;
|
|
6833
|
+
const modifierFlags = 1024 | 2048 | 8192 | 524288 | 8;
|
|
6799
6834
|
context = ((context | modifierFlags) ^ modifierFlags) | (isAsync ? 2048 : 0);
|
|
6800
6835
|
const expression = parser.getToken() !== 2162700;
|
|
6801
6836
|
let body;
|
|
@@ -6808,7 +6843,7 @@
|
|
|
6808
6843
|
}
|
|
6809
6844
|
else {
|
|
6810
6845
|
scope = scope?.createChildScope(64);
|
|
6811
|
-
const modifierFlags = 4 | 131072 | 8;
|
|
6846
|
+
const modifierFlags = 4 | 128 | 131072 | 8;
|
|
6812
6847
|
body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 4096, scope, privateScope, void 0, void 0, 16);
|
|
6813
6848
|
switch (parser.getToken()) {
|
|
6814
6849
|
case 69271571:
|
|
@@ -6818,7 +6853,9 @@
|
|
|
6818
6853
|
parser.flags |= 8192;
|
|
6819
6854
|
break;
|
|
6820
6855
|
case 67108877:
|
|
6856
|
+
case 67108991:
|
|
6821
6857
|
case 67174409:
|
|
6858
|
+
case 67174408:
|
|
6822
6859
|
case 22:
|
|
6823
6860
|
parser.report(119);
|
|
6824
6861
|
case 67174411:
|
|
@@ -6975,9 +7012,9 @@
|
|
|
6975
7012
|
}
|
|
6976
7013
|
const expr = parsePrimaryExpression(parser, context, privateScope, 2, 1, 0, inGroup, 1, tokenStart);
|
|
6977
7014
|
context = (context | 131072) ^ 131072;
|
|
7015
|
+
const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenStart);
|
|
6978
7016
|
if (parser.getToken() === 67108991)
|
|
6979
7017
|
parser.report(170);
|
|
6980
|
-
const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenStart);
|
|
6981
7018
|
parser.assignable = 2;
|
|
6982
7019
|
return parser.finishNode({
|
|
6983
7020
|
type: 'NewExpression',
|
|
@@ -7447,8 +7484,6 @@
|
|
|
7447
7484
|
}
|
|
7448
7485
|
else if (token === -2147483526) {
|
|
7449
7486
|
key = parseIdentifier(parser, context);
|
|
7450
|
-
if (parser.getToken() !== 67174411)
|
|
7451
|
-
parser.report(30, KeywordDescTable[parser.getToken() & 255]);
|
|
7452
7487
|
}
|
|
7453
7488
|
else {
|
|
7454
7489
|
parser.report(30, KeywordDescTable[parser.getToken() & 255]);
|
|
@@ -7464,7 +7499,7 @@
|
|
|
7464
7499
|
}
|
|
7465
7500
|
else if (parser.getToken() === 69271571) {
|
|
7466
7501
|
kind |= 2;
|
|
7467
|
-
key = parseComputedPropertyName(parser,
|
|
7502
|
+
key = parseComputedPropertyName(parser, inheritedContext, privateScope, 0);
|
|
7468
7503
|
}
|
|
7469
7504
|
else if (parser.getToken() === 131) {
|
|
7470
7505
|
kind |= 8192;
|
|
@@ -7552,6 +7587,7 @@
|
|
|
7552
7587
|
2048 |
|
|
7553
7588
|
8 |
|
|
7554
7589
|
8192 |
|
|
7590
|
+
32768 |
|
|
7555
7591
|
((state & 64) === 0 ? 512 | 16384 : 0);
|
|
7556
7592
|
context =
|
|
7557
7593
|
((context | modifierFlags) ^ modifierFlags) |
|