meriyah 4.1.5 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +2 -1
- package/dist/meriyah.amd.js +96 -72
- package/dist/meriyah.amd.min.js +1 -1
- package/dist/meriyah.cjs +94 -70
- package/dist/meriyah.cjs.js +94 -70
- package/dist/meriyah.cjs.min.js +1 -1
- package/dist/meriyah.esm.js +94 -70
- package/dist/meriyah.esm.min.js +1 -1
- package/dist/meriyah.esm.min.mjs +1 -0
- package/dist/meriyah.esm.mjs +8806 -0
- package/dist/meriyah.iife.js +95 -71
- package/dist/meriyah.iife.min.js +1 -1
- package/dist/meriyah.min.cjs +1 -1
- package/dist/meriyah.system.js +98 -74
- package/dist/meriyah.system.min.js +1 -1
- package/dist/meriyah.umd.cjs +96 -72
- package/dist/meriyah.umd.es5.js +108 -80
- package/dist/meriyah.umd.es5.min.js +1 -15
- package/dist/meriyah.umd.js +96 -72
- package/dist/meriyah.umd.min.cjs +1 -1
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/estree.d.ts +9 -4
- package/dist/src/estree.d.ts.map +1 -1
- package/dist/src/lexer/regexp.d.ts.map +1 -1
- package/dist/src/parser.d.ts +1 -0
- package/dist/src/parser.d.ts.map +1 -1
- package/dist/src/token.d.ts +2 -2
- package/package.json +25 -30
- package/src/errors.ts +0 -2
- package/src/estree.ts +11 -3
- package/src/lexer/numeric.ts +7 -7
- package/src/lexer/regexp.ts +22 -9
- package/src/lexer/scan.ts +1 -1
- package/src/parser.ts +94 -56
- package/src/token.ts +2 -2
package/dist/meriyah.iife.js
CHANGED
|
@@ -97,7 +97,6 @@ var meriyah = (function (exports) {
|
|
|
97
97
|
[89]: 'Illegal return statement',
|
|
98
98
|
[90]: 'The left hand side of the for-header binding declaration is not destructible',
|
|
99
99
|
[91]: 'new.target only allowed within functions',
|
|
100
|
-
[92]: "'Unexpected token: 'escaped keyword'",
|
|
101
100
|
[93]: "'#' not followed by identifier",
|
|
102
101
|
[99]: 'Invalid keyword',
|
|
103
102
|
[98]: "Can not use 'let' as a class name",
|
|
@@ -112,7 +111,6 @@ var meriyah = (function (exports) {
|
|
|
112
111
|
[104]: "Only '*' or '{...}' can be imported after default",
|
|
113
112
|
[105]: 'Trailing decorator may be followed by method',
|
|
114
113
|
[106]: "Decorators can't be used with a constructor",
|
|
115
|
-
[107]: "'%0' may not be used as an identifier in this context",
|
|
116
114
|
[108]: 'HTML comments are only allowed with web compatibility (Annex B)',
|
|
117
115
|
[109]: "The identifier 'let' must not be in expression position in strict mode",
|
|
118
116
|
[110]: 'Cannot assign to `eval` and `arguments` in strict mode',
|
|
@@ -868,7 +866,7 @@ var meriyah = (function (exports) {
|
|
|
868
866
|
break;
|
|
869
867
|
case 117:
|
|
870
868
|
if (mask & 16)
|
|
871
|
-
report(parser, 34, '
|
|
869
|
+
report(parser, 34, 'u');
|
|
872
870
|
mask |= 16;
|
|
873
871
|
break;
|
|
874
872
|
case 121:
|
|
@@ -877,9 +875,14 @@ var meriyah = (function (exports) {
|
|
|
877
875
|
mask |= 8;
|
|
878
876
|
break;
|
|
879
877
|
case 115:
|
|
880
|
-
if (mask &
|
|
878
|
+
if (mask & 32)
|
|
881
879
|
report(parser, 34, 's');
|
|
882
|
-
mask |=
|
|
880
|
+
mask |= 32;
|
|
881
|
+
break;
|
|
882
|
+
case 100:
|
|
883
|
+
if (mask & 64)
|
|
884
|
+
report(parser, 34, 'd');
|
|
885
|
+
mask |= 64;
|
|
883
886
|
break;
|
|
884
887
|
default:
|
|
885
888
|
report(parser, 33);
|
|
@@ -899,7 +902,13 @@ var meriyah = (function (exports) {
|
|
|
899
902
|
return new RegExp(pattern, flags);
|
|
900
903
|
}
|
|
901
904
|
catch (e) {
|
|
902
|
-
|
|
905
|
+
try {
|
|
906
|
+
new RegExp(pattern, flags.replace('d', ''));
|
|
907
|
+
return null;
|
|
908
|
+
}
|
|
909
|
+
catch (e) {
|
|
910
|
+
report(parser, 32);
|
|
911
|
+
}
|
|
903
912
|
}
|
|
904
913
|
}
|
|
905
914
|
|
|
@@ -1210,8 +1219,8 @@ var meriyah = (function (exports) {
|
|
|
1210
1219
|
digits++;
|
|
1211
1220
|
char = advanceChar(parser);
|
|
1212
1221
|
}
|
|
1213
|
-
if (digits
|
|
1214
|
-
report(parser, digits
|
|
1222
|
+
if (digits === 0 || !allowSeparator) {
|
|
1223
|
+
report(parser, digits === 0 ? 19 : 147);
|
|
1215
1224
|
}
|
|
1216
1225
|
}
|
|
1217
1226
|
else if ((char | 32) === 111) {
|
|
@@ -1231,8 +1240,8 @@ var meriyah = (function (exports) {
|
|
|
1231
1240
|
digits++;
|
|
1232
1241
|
char = advanceChar(parser);
|
|
1233
1242
|
}
|
|
1234
|
-
if (digits
|
|
1235
|
-
report(parser, digits
|
|
1243
|
+
if (digits === 0 || !allowSeparator) {
|
|
1244
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1236
1245
|
}
|
|
1237
1246
|
}
|
|
1238
1247
|
else if ((char | 32) === 98) {
|
|
@@ -1252,8 +1261,8 @@ var meriyah = (function (exports) {
|
|
|
1252
1261
|
digits++;
|
|
1253
1262
|
char = advanceChar(parser);
|
|
1254
1263
|
}
|
|
1255
|
-
if (digits
|
|
1256
|
-
report(parser, digits
|
|
1264
|
+
if (digits === 0 || !allowSeparator) {
|
|
1265
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1257
1266
|
}
|
|
1258
1267
|
}
|
|
1259
1268
|
else if (CharTypes[char] & 32) {
|
|
@@ -1329,7 +1338,7 @@ var meriyah = (function (exports) {
|
|
|
1329
1338
|
if (CharTypes[char] & 256)
|
|
1330
1339
|
char = advanceChar(parser);
|
|
1331
1340
|
const { index } = parser;
|
|
1332
|
-
if ((CharTypes[char] & 16)
|
|
1341
|
+
if ((CharTypes[char] & 16) === 0)
|
|
1333
1342
|
report(parser, 10);
|
|
1334
1343
|
value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
|
|
1335
1344
|
char = parser.currentChar;
|
|
@@ -1792,7 +1801,7 @@ var meriyah = (function (exports) {
|
|
|
1792
1801
|
}
|
|
1793
1802
|
else if (ch === 61) {
|
|
1794
1803
|
advanceChar(parser);
|
|
1795
|
-
return
|
|
1804
|
+
return 8456256;
|
|
1796
1805
|
}
|
|
1797
1806
|
if (ch === 33) {
|
|
1798
1807
|
const index = parser.index + 1;
|
|
@@ -1810,7 +1819,7 @@ var meriyah = (function (exports) {
|
|
|
1810
1819
|
return 8456258;
|
|
1811
1820
|
}
|
|
1812
1821
|
if (ch === 47) {
|
|
1813
|
-
if ((context & 16)
|
|
1822
|
+
if ((context & 16) === 0)
|
|
1814
1823
|
return 8456258;
|
|
1815
1824
|
const index = parser.index + 1;
|
|
1816
1825
|
if (index < parser.end) {
|
|
@@ -1975,7 +1984,7 @@ var meriyah = (function (exports) {
|
|
|
1975
1984
|
const ch = parser.currentChar;
|
|
1976
1985
|
if (ch === 61) {
|
|
1977
1986
|
advanceChar(parser);
|
|
1978
|
-
return
|
|
1987
|
+
return 8456257;
|
|
1979
1988
|
}
|
|
1980
1989
|
if (ch !== 62)
|
|
1981
1990
|
return 8456259;
|
|
@@ -4916,7 +4925,7 @@ var meriyah = (function (exports) {
|
|
|
4916
4925
|
case 86106:
|
|
4917
4926
|
report(parser, context & 1024
|
|
4918
4927
|
? 73
|
|
4919
|
-
: (context & 256)
|
|
4928
|
+
: (context & 256) === 0
|
|
4920
4929
|
? 75
|
|
4921
4930
|
: 74);
|
|
4922
4931
|
case 86096:
|
|
@@ -4962,12 +4971,12 @@ var meriyah = (function (exports) {
|
|
|
4962
4971
|
});
|
|
4963
4972
|
}
|
|
4964
4973
|
function parseReturnStatement(parser, context, start, line, column) {
|
|
4965
|
-
if ((context & 32)
|
|
4974
|
+
if ((context & 32) === 0 && context & 8192)
|
|
4966
4975
|
report(parser, 89);
|
|
4967
4976
|
nextToken(parser, context | 32768);
|
|
4968
4977
|
const argument = parser.flags & 1 || parser.token & 1048576
|
|
4969
4978
|
? null
|
|
4970
|
-
: parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.
|
|
4979
|
+
: parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
|
|
4971
4980
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
4972
4981
|
return finishNode(parser, context, start, line, column, {
|
|
4973
4982
|
type: 'ReturnStatement',
|
|
@@ -4986,7 +4995,7 @@ var meriyah = (function (exports) {
|
|
|
4986
4995
|
validateAndDeclareLabel(parser, labels, value);
|
|
4987
4996
|
nextToken(parser, context | 32768);
|
|
4988
4997
|
const body = allowFuncDecl &&
|
|
4989
|
-
(context & 1024)
|
|
4998
|
+
(context & 1024) === 0 &&
|
|
4990
4999
|
context & 256 &&
|
|
4991
5000
|
parser.token === 86106
|
|
4992
5001
|
? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
@@ -5095,7 +5104,7 @@ var meriyah = (function (exports) {
|
|
|
5095
5104
|
}
|
|
5096
5105
|
function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
|
|
5097
5106
|
return context & 1024 ||
|
|
5098
|
-
(context & 256)
|
|
5107
|
+
(context & 256) === 0 ||
|
|
5099
5108
|
parser.token !== 86106
|
|
5100
5109
|
? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
5101
5110
|
: parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
|
|
@@ -5160,11 +5169,11 @@ var meriyah = (function (exports) {
|
|
|
5160
5169
|
return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5161
5170
|
}
|
|
5162
5171
|
function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
5163
|
-
if ((context & 131072)
|
|
5172
|
+
if ((context & 131072) === 0)
|
|
5164
5173
|
report(parser, 65);
|
|
5165
5174
|
nextToken(parser, context);
|
|
5166
5175
|
let label = null;
|
|
5167
|
-
if ((parser.flags & 1)
|
|
5176
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5168
5177
|
const { tokenValue } = parser;
|
|
5169
5178
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5170
5179
|
if (!isValidLabel(parser, labels, tokenValue, 1))
|
|
@@ -5179,13 +5188,13 @@ var meriyah = (function (exports) {
|
|
|
5179
5188
|
function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
5180
5189
|
nextToken(parser, context | 32768);
|
|
5181
5190
|
let label = null;
|
|
5182
|
-
if ((parser.flags & 1)
|
|
5191
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5183
5192
|
const { tokenValue } = parser;
|
|
5184
5193
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5185
5194
|
if (!isValidLabel(parser, labels, tokenValue, 0))
|
|
5186
5195
|
report(parser, 134, tokenValue);
|
|
5187
5196
|
}
|
|
5188
|
-
else if ((context & (4096 | 131072))
|
|
5197
|
+
else if ((context & (4096 | 131072)) === 0) {
|
|
5189
5198
|
report(parser, 66);
|
|
5190
5199
|
}
|
|
5191
5200
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
@@ -5265,6 +5274,17 @@ var meriyah = (function (exports) {
|
|
|
5265
5274
|
body
|
|
5266
5275
|
});
|
|
5267
5276
|
}
|
|
5277
|
+
function parseStaticBlock(parser, context, scope, start, line, column) {
|
|
5278
|
+
if (scope)
|
|
5279
|
+
scope = addChildScope(scope, 2);
|
|
5280
|
+
const ctorContext = 16384 | 524288;
|
|
5281
|
+
context = ((context | ctorContext) ^ ctorContext) | 262144;
|
|
5282
|
+
const { body } = parseBlock(parser, context, scope, {}, start, line, column);
|
|
5283
|
+
return finishNode(parser, context, start, line, column, {
|
|
5284
|
+
type: 'StaticBlock',
|
|
5285
|
+
body
|
|
5286
|
+
});
|
|
5287
|
+
}
|
|
5268
5288
|
function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
|
|
5269
5289
|
nextToken(parser, context | 32768);
|
|
5270
5290
|
const body = parseIterationStatementBody(parser, context, scope, labels);
|
|
@@ -5352,10 +5372,10 @@ var meriyah = (function (exports) {
|
|
|
5352
5372
|
if (parser.token === 1077936157) {
|
|
5353
5373
|
nextToken(parser, context | 32768);
|
|
5354
5374
|
init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5355
|
-
if (origin & 32 || (token & 2097152)
|
|
5375
|
+
if (origin & 32 || (token & 2097152) === 0) {
|
|
5356
5376
|
if (parser.token === 274549 ||
|
|
5357
5377
|
(parser.token === 8738868 &&
|
|
5358
|
-
(token & 2097152 || (kind & 4)
|
|
5378
|
+
(token & 2097152 || (kind & 4) === 0 || context & 1024))) {
|
|
5359
5379
|
reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
|
|
5360
5380
|
}
|
|
5361
5381
|
}
|
|
@@ -5372,7 +5392,8 @@ var meriyah = (function (exports) {
|
|
|
5372
5392
|
}
|
|
5373
5393
|
function parseForStatement(parser, context, scope, labels, start, line, column) {
|
|
5374
5394
|
nextToken(parser, context);
|
|
5375
|
-
const forAwait = (context & 4194304) > 0 &&
|
|
5395
|
+
const forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
|
|
5396
|
+
consumeOpt(parser, context, 209008);
|
|
5376
5397
|
consume(parser, context | 32768, 67174411);
|
|
5377
5398
|
if (scope)
|
|
5378
5399
|
scope = addChildScope(scope, 1);
|
|
@@ -5661,7 +5682,7 @@ var meriyah = (function (exports) {
|
|
|
5661
5682
|
const { tokenPos, linePos, colPos } = parser;
|
|
5662
5683
|
declaration = parseIdentifier(parser, context, 0);
|
|
5663
5684
|
const { flags } = parser;
|
|
5664
|
-
if ((flags & 1)
|
|
5685
|
+
if ((flags & 1) === 0) {
|
|
5665
5686
|
if (parser.token === 86106) {
|
|
5666
5687
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
|
|
5667
5688
|
}
|
|
@@ -5785,7 +5806,7 @@ var meriyah = (function (exports) {
|
|
|
5785
5806
|
case 209007:
|
|
5786
5807
|
const { tokenPos, linePos, colPos } = parser;
|
|
5787
5808
|
nextToken(parser, context);
|
|
5788
|
-
if ((parser.flags & 1)
|
|
5809
|
+
if ((parser.flags & 1) === 0 && parser.token === 86106) {
|
|
5789
5810
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
|
|
5790
5811
|
if (scope) {
|
|
5791
5812
|
key = declaration.id ? declaration.id.name : '';
|
|
@@ -5942,7 +5963,7 @@ var meriyah = (function (exports) {
|
|
|
5942
5963
|
const { token } = parser;
|
|
5943
5964
|
const expr = parseIdentifier(parser, context, isPattern);
|
|
5944
5965
|
const { flags } = parser;
|
|
5945
|
-
if ((flags & 1)
|
|
5966
|
+
if ((flags & 1) === 0) {
|
|
5946
5967
|
if (parser.token === 86106) {
|
|
5947
5968
|
return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
|
|
5948
5969
|
}
|
|
@@ -5976,7 +5997,7 @@ var meriyah = (function (exports) {
|
|
|
5976
5997
|
report(parser, 120);
|
|
5977
5998
|
let argument = null;
|
|
5978
5999
|
let delegate = false;
|
|
5979
|
-
if ((parser.flags & 1)
|
|
6000
|
+
if ((parser.flags & 1) === 0) {
|
|
5980
6001
|
delegate = consumeOpt(parser, context | 32768, 8457014);
|
|
5981
6002
|
if (parser.token & (12288 | 65536) || delegate) {
|
|
5982
6003
|
argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
@@ -5996,7 +6017,7 @@ var meriyah = (function (exports) {
|
|
|
5996
6017
|
function parseAwaitExpression(parser, context, inNew, inGroup, start, line, column) {
|
|
5997
6018
|
if (inGroup)
|
|
5998
6019
|
parser.destructible |= 128;
|
|
5999
|
-
if (context & 4194304) {
|
|
6020
|
+
if (context & 4194304 || (context & 2048 && context & 8192)) {
|
|
6000
6021
|
if (inNew)
|
|
6001
6022
|
report(parser, 0);
|
|
6002
6023
|
if (context & 8388608) {
|
|
@@ -6004,6 +6025,8 @@ var meriyah = (function (exports) {
|
|
|
6004
6025
|
}
|
|
6005
6026
|
nextToken(parser, context | 32768);
|
|
6006
6027
|
const argument = parseLeftHandSideExpression(parser, context, 0, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
|
|
6028
|
+
if (parser.token === 8457273)
|
|
6029
|
+
report(parser, 31);
|
|
6007
6030
|
parser.assignable = 2;
|
|
6008
6031
|
return finishNode(parser, context, start, line, column, {
|
|
6009
6032
|
type: 'AwaitExpression',
|
|
@@ -6011,7 +6034,7 @@ var meriyah = (function (exports) {
|
|
|
6011
6034
|
});
|
|
6012
6035
|
}
|
|
6013
6036
|
if (context & 2048)
|
|
6014
|
-
report(parser,
|
|
6037
|
+
report(parser, 95);
|
|
6015
6038
|
return parseIdentifierOrArrow(parser, context, start, line, column);
|
|
6016
6039
|
}
|
|
6017
6040
|
function parseFunctionBody(parser, context, scope, origin, firstRestricted, scopeError) {
|
|
@@ -6051,8 +6074,8 @@ var meriyah = (function (exports) {
|
|
|
6051
6074
|
if (context & 64 &&
|
|
6052
6075
|
scope &&
|
|
6053
6076
|
scopeError !== void 0 &&
|
|
6054
|
-
(prevContext & 1024)
|
|
6055
|
-
(context & 8192)
|
|
6077
|
+
(prevContext & 1024) === 0 &&
|
|
6078
|
+
(context & 8192) === 0) {
|
|
6056
6079
|
reportScopeError(scopeError);
|
|
6057
6080
|
}
|
|
6058
6081
|
}
|
|
@@ -6078,19 +6101,19 @@ var meriyah = (function (exports) {
|
|
|
6078
6101
|
case 67108991:
|
|
6079
6102
|
report(parser, 161);
|
|
6080
6103
|
case 67174411: {
|
|
6081
|
-
if ((context & 524288)
|
|
6104
|
+
if ((context & 524288) === 0)
|
|
6082
6105
|
report(parser, 26);
|
|
6083
6106
|
if (context & 16384)
|
|
6084
|
-
report(parser,
|
|
6107
|
+
report(parser, 27);
|
|
6085
6108
|
parser.assignable = 2;
|
|
6086
6109
|
break;
|
|
6087
6110
|
}
|
|
6088
6111
|
case 69271571:
|
|
6089
6112
|
case 67108877: {
|
|
6090
|
-
if ((context & 262144)
|
|
6113
|
+
if ((context & 262144) === 0)
|
|
6091
6114
|
report(parser, 27);
|
|
6092
6115
|
if (context & 16384)
|
|
6093
|
-
report(parser,
|
|
6116
|
+
report(parser, 27);
|
|
6094
6117
|
parser.assignable = 1;
|
|
6095
6118
|
break;
|
|
6096
6119
|
}
|
|
@@ -6117,14 +6140,14 @@ var meriyah = (function (exports) {
|
|
|
6117
6140
|
});
|
|
6118
6141
|
}
|
|
6119
6142
|
function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain, start, line, column) {
|
|
6120
|
-
if ((parser.token & 33619968) === 33619968 && (parser.flags & 1)
|
|
6143
|
+
if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) === 0) {
|
|
6121
6144
|
expr = parseUpdateExpression(parser, context, expr, start, line, column);
|
|
6122
6145
|
}
|
|
6123
6146
|
else if ((parser.token & 67108864) === 67108864) {
|
|
6124
|
-
context = (context | 134217728
|
|
6147
|
+
context = (context | 134217728) ^ 134217728;
|
|
6125
6148
|
switch (parser.token) {
|
|
6126
6149
|
case 67108877: {
|
|
6127
|
-
nextToken(parser, context | 1073741824);
|
|
6150
|
+
nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
|
|
6128
6151
|
parser.assignable = 1;
|
|
6129
6152
|
const property = parsePropertyOrPrivatePropertyName(parser, context);
|
|
6130
6153
|
expr = finishNode(parser, context, start, line, column, {
|
|
@@ -6180,7 +6203,7 @@ var meriyah = (function (exports) {
|
|
|
6180
6203
|
break;
|
|
6181
6204
|
}
|
|
6182
6205
|
case 67108991: {
|
|
6183
|
-
nextToken(parser, context);
|
|
6206
|
+
nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
|
|
6184
6207
|
parser.flags |= 2048;
|
|
6185
6208
|
parser.assignable = 2;
|
|
6186
6209
|
expr = parseOptionalChain(parser, context, expr, start, line, column);
|
|
@@ -6244,7 +6267,7 @@ var meriyah = (function (exports) {
|
|
|
6244
6267
|
});
|
|
6245
6268
|
}
|
|
6246
6269
|
else {
|
|
6247
|
-
if ((parser.token & (143360 | 4096))
|
|
6270
|
+
if ((parser.token & (143360 | 4096)) === 0)
|
|
6248
6271
|
report(parser, 154);
|
|
6249
6272
|
const property = parseIdentifier(parser, context, 0);
|
|
6250
6273
|
parser.assignable = 2;
|
|
@@ -6262,7 +6285,7 @@ var meriyah = (function (exports) {
|
|
|
6262
6285
|
return node;
|
|
6263
6286
|
}
|
|
6264
6287
|
function parsePropertyOrPrivatePropertyName(parser, context) {
|
|
6265
|
-
if ((parser.token & (143360 | 4096))
|
|
6288
|
+
if ((parser.token & (143360 | 4096)) === 0 && parser.token !== 131) {
|
|
6266
6289
|
report(parser, 154);
|
|
6267
6290
|
}
|
|
6268
6291
|
return context & 1 && parser.token === 131
|
|
@@ -6587,11 +6610,11 @@ var meriyah = (function (exports) {
|
|
|
6587
6610
|
let firstRestricted;
|
|
6588
6611
|
let functionScope = scope ? createScope() : void 0;
|
|
6589
6612
|
if (parser.token === 67174411) {
|
|
6590
|
-
if ((flags & 1)
|
|
6613
|
+
if ((flags & 1) === 0)
|
|
6591
6614
|
report(parser, 37, 'Function');
|
|
6592
6615
|
}
|
|
6593
6616
|
else {
|
|
6594
|
-
const kind = origin & 4 && ((context & 8192)
|
|
6617
|
+
const kind = origin & 4 && ((context & 8192) === 0 || (context & 2048) === 0)
|
|
6595
6618
|
? 4
|
|
6596
6619
|
: 64;
|
|
6597
6620
|
validateFunctionName(parser, context | ((context & 3072) << 11), parser.token);
|
|
@@ -6737,7 +6760,7 @@ var meriyah = (function (exports) {
|
|
|
6737
6760
|
destructible |=
|
|
6738
6761
|
kind & 1
|
|
6739
6762
|
? 32
|
|
6740
|
-
: (kind & 2)
|
|
6763
|
+
: (kind & 2) === 0
|
|
6741
6764
|
? 16
|
|
6742
6765
|
: 0;
|
|
6743
6766
|
left = parseMemberOrUpdateExpression(parser, context, left, inGroup, 0, tokenPos, linePos, colPos);
|
|
@@ -6796,7 +6819,7 @@ var meriyah = (function (exports) {
|
|
|
6796
6819
|
left = parseLeftHandSideExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
|
|
6797
6820
|
if (parser.token !== 18 && parser.token !== 20) {
|
|
6798
6821
|
left = parseAssignmentExpression(parser, context, inGroup, isPattern, tokenPos, linePos, colPos, left);
|
|
6799
|
-
if ((kind & (2 | 1))
|
|
6822
|
+
if ((kind & (2 | 1)) === 0 && token === 67174411)
|
|
6800
6823
|
destructible |= 16;
|
|
6801
6824
|
}
|
|
6802
6825
|
else if (parser.assignable & 2) {
|
|
@@ -6985,7 +7008,7 @@ var meriyah = (function (exports) {
|
|
|
6985
7008
|
});
|
|
6986
7009
|
}
|
|
6987
7010
|
function parseMethodDefinition(parser, context, kind, inGroup, start, line, column) {
|
|
6988
|
-
const modifierFlags = (kind & 64)
|
|
7011
|
+
const modifierFlags = (kind & 64) === 0 ? 31981568 : 14680064;
|
|
6989
7012
|
context =
|
|
6990
7013
|
((context | modifierFlags) ^ modifierFlags) |
|
|
6991
7014
|
((kind & 88) << 18) |
|
|
@@ -7553,7 +7576,7 @@ var meriyah = (function (exports) {
|
|
|
7553
7576
|
let left = null;
|
|
7554
7577
|
const { tokenPos, linePos, colPos } = parser;
|
|
7555
7578
|
if (parser.token & 143360) {
|
|
7556
|
-
if ((context & 1024)
|
|
7579
|
+
if ((context & 1024) === 0) {
|
|
7557
7580
|
if ((parser.token & 36864) === 36864) {
|
|
7558
7581
|
parser.flags |= 256;
|
|
7559
7582
|
}
|
|
@@ -7616,7 +7639,7 @@ var meriyah = (function (exports) {
|
|
|
7616
7639
|
const { tokenPos: piStart, linePos: plStart, colPos: pcStart } = parser;
|
|
7617
7640
|
nextToken(parser, context | 32768 | 1073741824);
|
|
7618
7641
|
const scope = context & 64 ? addChildScope(createScope(), 1024) : void 0;
|
|
7619
|
-
context = (context | 134217728
|
|
7642
|
+
context = (context | 134217728) ^ 134217728;
|
|
7620
7643
|
if (consumeOpt(parser, context, 16)) {
|
|
7621
7644
|
return parseParenthesizedArrow(parser, context, scope, [], canAssign, 0, start, line, column);
|
|
7622
7645
|
}
|
|
@@ -7814,7 +7837,7 @@ var meriyah = (function (exports) {
|
|
|
7814
7837
|
(134221824 | 8192 | 16384), scope, 16, void 0, void 0);
|
|
7815
7838
|
switch (parser.token) {
|
|
7816
7839
|
case 69271571:
|
|
7817
|
-
if ((parser.flags & 1)
|
|
7840
|
+
if ((parser.flags & 1) === 0) {
|
|
7818
7841
|
report(parser, 112);
|
|
7819
7842
|
}
|
|
7820
7843
|
break;
|
|
@@ -7823,13 +7846,13 @@ var meriyah = (function (exports) {
|
|
|
7823
7846
|
case 22:
|
|
7824
7847
|
report(parser, 113);
|
|
7825
7848
|
case 67174411:
|
|
7826
|
-
if ((parser.flags & 1)
|
|
7849
|
+
if ((parser.flags & 1) === 0) {
|
|
7827
7850
|
report(parser, 112);
|
|
7828
7851
|
}
|
|
7829
7852
|
parser.flags |= 1024;
|
|
7830
7853
|
break;
|
|
7831
7854
|
}
|
|
7832
|
-
if ((parser.token & 8454144) === 8454144 && (parser.flags & 1)
|
|
7855
|
+
if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) === 0)
|
|
7833
7856
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
7834
7857
|
if ((parser.token & 33619968) === 33619968)
|
|
7835
7858
|
report(parser, 121);
|
|
@@ -7855,7 +7878,7 @@ var meriyah = (function (exports) {
|
|
|
7855
7878
|
let left;
|
|
7856
7879
|
const { tokenPos, linePos, colPos } = parser;
|
|
7857
7880
|
if (parser.token & 143360) {
|
|
7858
|
-
if ((context & 1024)
|
|
7881
|
+
if ((context & 1024) === 0) {
|
|
7859
7882
|
if ((parser.token & 36864) === 36864) {
|
|
7860
7883
|
parser.flags |= 256;
|
|
7861
7884
|
}
|
|
@@ -8175,7 +8198,7 @@ var meriyah = (function (exports) {
|
|
|
8175
8198
|
id = parseIdentifier(parser, context, 0);
|
|
8176
8199
|
}
|
|
8177
8200
|
else {
|
|
8178
|
-
if ((flags & 1)
|
|
8201
|
+
if ((flags & 1) === 0)
|
|
8179
8202
|
report(parser, 37, 'Class');
|
|
8180
8203
|
}
|
|
8181
8204
|
let inheritedContext = context;
|
|
@@ -8306,7 +8329,7 @@ var meriyah = (function (exports) {
|
|
|
8306
8329
|
}
|
|
8307
8330
|
break;
|
|
8308
8331
|
case 209007:
|
|
8309
|
-
if (parser.token !== 67174411 && (parser.flags & 1)
|
|
8332
|
+
if (parser.token !== 67174411 && (parser.flags & 1) === 0) {
|
|
8310
8333
|
if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8311
8334
|
return parsePropertyDefinition(parser, context, key, kind, decorators, tokenPos, linePos, colPos);
|
|
8312
8335
|
}
|
|
@@ -8344,12 +8367,13 @@ var meriyah = (function (exports) {
|
|
|
8344
8367
|
}
|
|
8345
8368
|
else if (context & 1 && parser.token === 131) {
|
|
8346
8369
|
kind |= 4096;
|
|
8347
|
-
key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
|
|
8348
|
-
context = context | 16384;
|
|
8370
|
+
key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
|
|
8349
8371
|
}
|
|
8350
8372
|
else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8351
8373
|
kind |= 128;
|
|
8352
|
-
|
|
8374
|
+
}
|
|
8375
|
+
else if (isStatic && token === 2162700) {
|
|
8376
|
+
return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
|
|
8353
8377
|
}
|
|
8354
8378
|
else if (token === 122) {
|
|
8355
8379
|
key = parseIdentifier(parser, context, 0);
|
|
@@ -8380,16 +8404,16 @@ var meriyah = (function (exports) {
|
|
|
8380
8404
|
else
|
|
8381
8405
|
report(parser, 131);
|
|
8382
8406
|
}
|
|
8383
|
-
if ((kind & 2)
|
|
8407
|
+
if ((kind & 2) === 0) {
|
|
8384
8408
|
if (parser.tokenValue === 'constructor') {
|
|
8385
8409
|
if ((parser.token & 1073741824) === 1073741824) {
|
|
8386
8410
|
report(parser, 125);
|
|
8387
8411
|
}
|
|
8388
|
-
else if ((kind & 32)
|
|
8412
|
+
else if ((kind & 32) === 0 && parser.token === 67174411) {
|
|
8389
8413
|
if (kind & (768 | 16 | 128 | 8)) {
|
|
8390
8414
|
report(parser, 50, 'accessor');
|
|
8391
8415
|
}
|
|
8392
|
-
else if ((context & 524288)
|
|
8416
|
+
else if ((context & 524288) === 0) {
|
|
8393
8417
|
if (parser.flags & 32)
|
|
8394
8418
|
report(parser, 51);
|
|
8395
8419
|
else
|
|
@@ -8398,7 +8422,7 @@ var meriyah = (function (exports) {
|
|
|
8398
8422
|
}
|
|
8399
8423
|
kind |= 64;
|
|
8400
8424
|
}
|
|
8401
|
-
else if ((kind & 4096)
|
|
8425
|
+
else if ((kind & 4096) === 0 &&
|
|
8402
8426
|
kind & (32 | 768 | 8 | 16) &&
|
|
8403
8427
|
parser.tokenValue === 'prototype') {
|
|
8404
8428
|
report(parser, 49);
|
|
@@ -8411,7 +8435,7 @@ var meriyah = (function (exports) {
|
|
|
8411
8435
|
return finishNode(parser, context, start, line, column, context & 1
|
|
8412
8436
|
? {
|
|
8413
8437
|
type: 'MethodDefinition',
|
|
8414
|
-
kind: (kind & 32)
|
|
8438
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8415
8439
|
? 'constructor'
|
|
8416
8440
|
: kind & 256
|
|
8417
8441
|
? 'get'
|
|
@@ -8426,7 +8450,7 @@ var meriyah = (function (exports) {
|
|
|
8426
8450
|
}
|
|
8427
8451
|
: {
|
|
8428
8452
|
type: 'MethodDefinition',
|
|
8429
|
-
kind: (kind & 32)
|
|
8453
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8430
8454
|
? 'constructor'
|
|
8431
8455
|
: kind & 256
|
|
8432
8456
|
? 'get'
|
|
@@ -8715,7 +8739,7 @@ var meriyah = (function (exports) {
|
|
|
8715
8739
|
});
|
|
8716
8740
|
}
|
|
8717
8741
|
function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
|
|
8718
|
-
nextToken(parser, context);
|
|
8742
|
+
nextToken(parser, context | 32768);
|
|
8719
8743
|
const { tokenPos, linePos, colPos } = parser;
|
|
8720
8744
|
if (parser.token === 14)
|
|
8721
8745
|
return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
|
|
@@ -8769,7 +8793,7 @@ var meriyah = (function (exports) {
|
|
|
8769
8793
|
__proto__: null
|
|
8770
8794
|
});
|
|
8771
8795
|
|
|
8772
|
-
var version$1 = "4.
|
|
8796
|
+
var version$1 = "4.3.0";
|
|
8773
8797
|
|
|
8774
8798
|
const version = version$1;
|
|
8775
8799
|
function parseScript(source, options) {
|
|
@@ -8792,4 +8816,4 @@ var meriyah = (function (exports) {
|
|
|
8792
8816
|
|
|
8793
8817
|
return exports;
|
|
8794
8818
|
|
|
8795
|
-
}({})
|
|
8819
|
+
})({});
|