meriyah 4.2.1 → 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 +17 -0
- package/dist/meriyah.amd.js +77 -51
- package/dist/meriyah.amd.min.js +1 -1
- package/dist/meriyah.cjs +77 -51
- package/dist/meriyah.cjs.js +77 -51
- package/dist/meriyah.cjs.min.js +1 -1
- package/dist/meriyah.esm.js +77 -51
- 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 +77 -51
- package/dist/meriyah.iife.min.js +1 -1
- package/dist/meriyah.min.cjs +1 -1
- package/dist/meriyah.system.js +77 -51
- package/dist/meriyah.system.min.js +1 -1
- package/dist/meriyah.umd.cjs +77 -51
- package/dist/meriyah.umd.es5.js +88 -58
- package/dist/meriyah.umd.es5.min.js +1 -15
- package/dist/meriyah.umd.js +77 -51
- package/dist/meriyah.umd.min.cjs +1 -1
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/src/estree.d.ts +9 -4
- package/dist/src/estree.d.ts.map +1 -1
- package/dist/src/lexer/regexp.d.ts.map +1 -1
- package/dist/src/parser.d.ts +1 -0
- package/dist/src/parser.d.ts.map +1 -1
- package/package.json +25 -30
- 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 +81 -42
package/dist/meriyah.iife.js
CHANGED
|
@@ -866,7 +866,7 @@ var meriyah = (function (exports) {
|
|
|
866
866
|
break;
|
|
867
867
|
case 117:
|
|
868
868
|
if (mask & 16)
|
|
869
|
-
report(parser, 34, '
|
|
869
|
+
report(parser, 34, 'u');
|
|
870
870
|
mask |= 16;
|
|
871
871
|
break;
|
|
872
872
|
case 121:
|
|
@@ -879,6 +879,11 @@ var meriyah = (function (exports) {
|
|
|
879
879
|
report(parser, 34, 's');
|
|
880
880
|
mask |= 32;
|
|
881
881
|
break;
|
|
882
|
+
case 100:
|
|
883
|
+
if (mask & 64)
|
|
884
|
+
report(parser, 34, 'd');
|
|
885
|
+
mask |= 64;
|
|
886
|
+
break;
|
|
882
887
|
default:
|
|
883
888
|
report(parser, 33);
|
|
884
889
|
}
|
|
@@ -897,7 +902,13 @@ var meriyah = (function (exports) {
|
|
|
897
902
|
return new RegExp(pattern, flags);
|
|
898
903
|
}
|
|
899
904
|
catch (e) {
|
|
900
|
-
|
|
905
|
+
try {
|
|
906
|
+
new RegExp(pattern, flags.replace('d', ''));
|
|
907
|
+
return null;
|
|
908
|
+
}
|
|
909
|
+
catch (e) {
|
|
910
|
+
report(parser, 32);
|
|
911
|
+
}
|
|
901
912
|
}
|
|
902
913
|
}
|
|
903
914
|
|
|
@@ -1208,8 +1219,8 @@ var meriyah = (function (exports) {
|
|
|
1208
1219
|
digits++;
|
|
1209
1220
|
char = advanceChar(parser);
|
|
1210
1221
|
}
|
|
1211
|
-
if (digits
|
|
1212
|
-
report(parser, digits
|
|
1222
|
+
if (digits === 0 || !allowSeparator) {
|
|
1223
|
+
report(parser, digits === 0 ? 19 : 147);
|
|
1213
1224
|
}
|
|
1214
1225
|
}
|
|
1215
1226
|
else if ((char | 32) === 111) {
|
|
@@ -1229,8 +1240,8 @@ var meriyah = (function (exports) {
|
|
|
1229
1240
|
digits++;
|
|
1230
1241
|
char = advanceChar(parser);
|
|
1231
1242
|
}
|
|
1232
|
-
if (digits
|
|
1233
|
-
report(parser, digits
|
|
1243
|
+
if (digits === 0 || !allowSeparator) {
|
|
1244
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1234
1245
|
}
|
|
1235
1246
|
}
|
|
1236
1247
|
else if ((char | 32) === 98) {
|
|
@@ -1250,8 +1261,8 @@ var meriyah = (function (exports) {
|
|
|
1250
1261
|
digits++;
|
|
1251
1262
|
char = advanceChar(parser);
|
|
1252
1263
|
}
|
|
1253
|
-
if (digits
|
|
1254
|
-
report(parser, digits
|
|
1264
|
+
if (digits === 0 || !allowSeparator) {
|
|
1265
|
+
report(parser, digits === 0 ? 0 : 147);
|
|
1255
1266
|
}
|
|
1256
1267
|
}
|
|
1257
1268
|
else if (CharTypes[char] & 32) {
|
|
@@ -1327,7 +1338,7 @@ var meriyah = (function (exports) {
|
|
|
1327
1338
|
if (CharTypes[char] & 256)
|
|
1328
1339
|
char = advanceChar(parser);
|
|
1329
1340
|
const { index } = parser;
|
|
1330
|
-
if ((CharTypes[char] & 16)
|
|
1341
|
+
if ((CharTypes[char] & 16) === 0)
|
|
1331
1342
|
report(parser, 10);
|
|
1332
1343
|
value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
|
|
1333
1344
|
char = parser.currentChar;
|
|
@@ -1808,7 +1819,7 @@ var meriyah = (function (exports) {
|
|
|
1808
1819
|
return 8456258;
|
|
1809
1820
|
}
|
|
1810
1821
|
if (ch === 47) {
|
|
1811
|
-
if ((context & 16)
|
|
1822
|
+
if ((context & 16) === 0)
|
|
1812
1823
|
return 8456258;
|
|
1813
1824
|
const index = parser.index + 1;
|
|
1814
1825
|
if (index < parser.end) {
|
|
@@ -4914,7 +4925,7 @@ var meriyah = (function (exports) {
|
|
|
4914
4925
|
case 86106:
|
|
4915
4926
|
report(parser, context & 1024
|
|
4916
4927
|
? 73
|
|
4917
|
-
: (context & 256)
|
|
4928
|
+
: (context & 256) === 0
|
|
4918
4929
|
? 75
|
|
4919
4930
|
: 74);
|
|
4920
4931
|
case 86096:
|
|
@@ -4960,7 +4971,7 @@ var meriyah = (function (exports) {
|
|
|
4960
4971
|
});
|
|
4961
4972
|
}
|
|
4962
4973
|
function parseReturnStatement(parser, context, start, line, column) {
|
|
4963
|
-
if ((context & 32)
|
|
4974
|
+
if ((context & 32) === 0 && context & 8192)
|
|
4964
4975
|
report(parser, 89);
|
|
4965
4976
|
nextToken(parser, context | 32768);
|
|
4966
4977
|
const argument = parser.flags & 1 || parser.token & 1048576
|
|
@@ -4984,7 +4995,7 @@ var meriyah = (function (exports) {
|
|
|
4984
4995
|
validateAndDeclareLabel(parser, labels, value);
|
|
4985
4996
|
nextToken(parser, context | 32768);
|
|
4986
4997
|
const body = allowFuncDecl &&
|
|
4987
|
-
(context & 1024)
|
|
4998
|
+
(context & 1024) === 0 &&
|
|
4988
4999
|
context & 256 &&
|
|
4989
5000
|
parser.token === 86106
|
|
4990
5001
|
? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
@@ -5093,7 +5104,7 @@ var meriyah = (function (exports) {
|
|
|
5093
5104
|
}
|
|
5094
5105
|
function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
|
|
5095
5106
|
return context & 1024 ||
|
|
5096
|
-
(context & 256)
|
|
5107
|
+
(context & 256) === 0 ||
|
|
5097
5108
|
parser.token !== 86106
|
|
5098
5109
|
? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
|
|
5099
5110
|
: parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
|
|
@@ -5158,11 +5169,11 @@ var meriyah = (function (exports) {
|
|
|
5158
5169
|
return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5159
5170
|
}
|
|
5160
5171
|
function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
5161
|
-
if ((context & 131072)
|
|
5172
|
+
if ((context & 131072) === 0)
|
|
5162
5173
|
report(parser, 65);
|
|
5163
5174
|
nextToken(parser, context);
|
|
5164
5175
|
let label = null;
|
|
5165
|
-
if ((parser.flags & 1)
|
|
5176
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5166
5177
|
const { tokenValue } = parser;
|
|
5167
5178
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5168
5179
|
if (!isValidLabel(parser, labels, tokenValue, 1))
|
|
@@ -5177,13 +5188,13 @@ var meriyah = (function (exports) {
|
|
|
5177
5188
|
function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
5178
5189
|
nextToken(parser, context | 32768);
|
|
5179
5190
|
let label = null;
|
|
5180
|
-
if ((parser.flags & 1)
|
|
5191
|
+
if ((parser.flags & 1) === 0 && parser.token & 143360) {
|
|
5181
5192
|
const { tokenValue } = parser;
|
|
5182
5193
|
label = parseIdentifier(parser, context | 32768, 0);
|
|
5183
5194
|
if (!isValidLabel(parser, labels, tokenValue, 0))
|
|
5184
5195
|
report(parser, 134, tokenValue);
|
|
5185
5196
|
}
|
|
5186
|
-
else if ((context & (4096 | 131072))
|
|
5197
|
+
else if ((context & (4096 | 131072)) === 0) {
|
|
5187
5198
|
report(parser, 66);
|
|
5188
5199
|
}
|
|
5189
5200
|
matchOrInsertSemicolon(parser, context | 32768);
|
|
@@ -5263,6 +5274,17 @@ var meriyah = (function (exports) {
|
|
|
5263
5274
|
body
|
|
5264
5275
|
});
|
|
5265
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
|
+
}
|
|
5266
5288
|
function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
|
|
5267
5289
|
nextToken(parser, context | 32768);
|
|
5268
5290
|
const body = parseIterationStatementBody(parser, context, scope, labels);
|
|
@@ -5350,10 +5372,10 @@ var meriyah = (function (exports) {
|
|
|
5350
5372
|
if (parser.token === 1077936157) {
|
|
5351
5373
|
nextToken(parser, context | 32768);
|
|
5352
5374
|
init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
5353
|
-
if (origin & 32 || (token & 2097152)
|
|
5375
|
+
if (origin & 32 || (token & 2097152) === 0) {
|
|
5354
5376
|
if (parser.token === 274549 ||
|
|
5355
5377
|
(parser.token === 8738868 &&
|
|
5356
|
-
(token & 2097152 || (kind & 4)
|
|
5378
|
+
(token & 2097152 || (kind & 4) === 0 || context & 1024))) {
|
|
5357
5379
|
reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
|
|
5358
5380
|
}
|
|
5359
5381
|
}
|
|
@@ -5370,7 +5392,8 @@ var meriyah = (function (exports) {
|
|
|
5370
5392
|
}
|
|
5371
5393
|
function parseForStatement(parser, context, scope, labels, start, line, column) {
|
|
5372
5394
|
nextToken(parser, context);
|
|
5373
|
-
const forAwait = (context & 4194304) > 0 &&
|
|
5395
|
+
const forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
|
|
5396
|
+
consumeOpt(parser, context, 209008);
|
|
5374
5397
|
consume(parser, context | 32768, 67174411);
|
|
5375
5398
|
if (scope)
|
|
5376
5399
|
scope = addChildScope(scope, 1);
|
|
@@ -5659,7 +5682,7 @@ var meriyah = (function (exports) {
|
|
|
5659
5682
|
const { tokenPos, linePos, colPos } = parser;
|
|
5660
5683
|
declaration = parseIdentifier(parser, context, 0);
|
|
5661
5684
|
const { flags } = parser;
|
|
5662
|
-
if ((flags & 1)
|
|
5685
|
+
if ((flags & 1) === 0) {
|
|
5663
5686
|
if (parser.token === 86106) {
|
|
5664
5687
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
|
|
5665
5688
|
}
|
|
@@ -5783,7 +5806,7 @@ var meriyah = (function (exports) {
|
|
|
5783
5806
|
case 209007:
|
|
5784
5807
|
const { tokenPos, linePos, colPos } = parser;
|
|
5785
5808
|
nextToken(parser, context);
|
|
5786
|
-
if ((parser.flags & 1)
|
|
5809
|
+
if ((parser.flags & 1) === 0 && parser.token === 86106) {
|
|
5787
5810
|
declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
|
|
5788
5811
|
if (scope) {
|
|
5789
5812
|
key = declaration.id ? declaration.id.name : '';
|
|
@@ -5940,7 +5963,7 @@ var meriyah = (function (exports) {
|
|
|
5940
5963
|
const { token } = parser;
|
|
5941
5964
|
const expr = parseIdentifier(parser, context, isPattern);
|
|
5942
5965
|
const { flags } = parser;
|
|
5943
|
-
if ((flags & 1)
|
|
5966
|
+
if ((flags & 1) === 0) {
|
|
5944
5967
|
if (parser.token === 86106) {
|
|
5945
5968
|
return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
|
|
5946
5969
|
}
|
|
@@ -5974,7 +5997,7 @@ var meriyah = (function (exports) {
|
|
|
5974
5997
|
report(parser, 120);
|
|
5975
5998
|
let argument = null;
|
|
5976
5999
|
let delegate = false;
|
|
5977
|
-
if ((parser.flags & 1)
|
|
6000
|
+
if ((parser.flags & 1) === 0) {
|
|
5978
6001
|
delegate = consumeOpt(parser, context | 32768, 8457014);
|
|
5979
6002
|
if (parser.token & (12288 | 65536) || delegate) {
|
|
5980
6003
|
argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
|
|
@@ -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,7 +6101,7 @@ 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
6107
|
report(parser, 27);
|
|
@@ -6087,7 +6110,7 @@ var meriyah = (function (exports) {
|
|
|
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
6116
|
report(parser, 27);
|
|
@@ -6117,7 +6140,7 @@ 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) {
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -8349,6 +8372,9 @@ var meriyah = (function (exports) {
|
|
|
8349
8372
|
else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
|
|
8350
8373
|
kind |= 128;
|
|
8351
8374
|
}
|
|
8375
|
+
else if (isStatic && token === 2162700) {
|
|
8376
|
+
return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
|
|
8377
|
+
}
|
|
8352
8378
|
else if (token === 122) {
|
|
8353
8379
|
key = parseIdentifier(parser, context, 0);
|
|
8354
8380
|
if (parser.token !== 67174411)
|
|
@@ -8378,16 +8404,16 @@ var meriyah = (function (exports) {
|
|
|
8378
8404
|
else
|
|
8379
8405
|
report(parser, 131);
|
|
8380
8406
|
}
|
|
8381
|
-
if ((kind & 2)
|
|
8407
|
+
if ((kind & 2) === 0) {
|
|
8382
8408
|
if (parser.tokenValue === 'constructor') {
|
|
8383
8409
|
if ((parser.token & 1073741824) === 1073741824) {
|
|
8384
8410
|
report(parser, 125);
|
|
8385
8411
|
}
|
|
8386
|
-
else if ((kind & 32)
|
|
8412
|
+
else if ((kind & 32) === 0 && parser.token === 67174411) {
|
|
8387
8413
|
if (kind & (768 | 16 | 128 | 8)) {
|
|
8388
8414
|
report(parser, 50, 'accessor');
|
|
8389
8415
|
}
|
|
8390
|
-
else if ((context & 524288)
|
|
8416
|
+
else if ((context & 524288) === 0) {
|
|
8391
8417
|
if (parser.flags & 32)
|
|
8392
8418
|
report(parser, 51);
|
|
8393
8419
|
else
|
|
@@ -8396,7 +8422,7 @@ var meriyah = (function (exports) {
|
|
|
8396
8422
|
}
|
|
8397
8423
|
kind |= 64;
|
|
8398
8424
|
}
|
|
8399
|
-
else if ((kind & 4096)
|
|
8425
|
+
else if ((kind & 4096) === 0 &&
|
|
8400
8426
|
kind & (32 | 768 | 8 | 16) &&
|
|
8401
8427
|
parser.tokenValue === 'prototype') {
|
|
8402
8428
|
report(parser, 49);
|
|
@@ -8409,7 +8435,7 @@ var meriyah = (function (exports) {
|
|
|
8409
8435
|
return finishNode(parser, context, start, line, column, context & 1
|
|
8410
8436
|
? {
|
|
8411
8437
|
type: 'MethodDefinition',
|
|
8412
|
-
kind: (kind & 32)
|
|
8438
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8413
8439
|
? 'constructor'
|
|
8414
8440
|
: kind & 256
|
|
8415
8441
|
? 'get'
|
|
@@ -8424,7 +8450,7 @@ var meriyah = (function (exports) {
|
|
|
8424
8450
|
}
|
|
8425
8451
|
: {
|
|
8426
8452
|
type: 'MethodDefinition',
|
|
8427
|
-
kind: (kind & 32)
|
|
8453
|
+
kind: (kind & 32) === 0 && kind & 64
|
|
8428
8454
|
? 'constructor'
|
|
8429
8455
|
: kind & 256
|
|
8430
8456
|
? 'get'
|
|
@@ -8767,7 +8793,7 @@ var meriyah = (function (exports) {
|
|
|
8767
8793
|
__proto__: null
|
|
8768
8794
|
});
|
|
8769
8795
|
|
|
8770
|
-
var version$1 = "4.
|
|
8796
|
+
var version$1 = "4.3.0";
|
|
8771
8797
|
|
|
8772
8798
|
const version = version$1;
|
|
8773
8799
|
function parseScript(source, options) {
|