meriyah 4.2.0 → 4.3.1

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/dist/meriyah.cjs CHANGED
@@ -867,7 +867,7 @@ function scanRegularExpression(parser, context) {
867
867
  break;
868
868
  case 117:
869
869
  if (mask & 16)
870
- report(parser, 34, 'g');
870
+ report(parser, 34, 'u');
871
871
  mask |= 16;
872
872
  break;
873
873
  case 121:
@@ -876,9 +876,14 @@ function scanRegularExpression(parser, context) {
876
876
  mask |= 8;
877
877
  break;
878
878
  case 115:
879
- if (mask & 12)
879
+ if (mask & 32)
880
880
  report(parser, 34, 's');
881
- mask |= 12;
881
+ mask |= 32;
882
+ break;
883
+ case 100:
884
+ if (mask & 64)
885
+ report(parser, 34, 'd');
886
+ mask |= 64;
882
887
  break;
883
888
  default:
884
889
  report(parser, 33);
@@ -898,7 +903,13 @@ function validate(parser, pattern, flags) {
898
903
  return new RegExp(pattern, flags);
899
904
  }
900
905
  catch (e) {
901
- report(parser, 32);
906
+ try {
907
+ new RegExp(pattern, flags.replace('d', ''));
908
+ return null;
909
+ }
910
+ catch (e) {
911
+ report(parser, 32);
912
+ }
902
913
  }
903
914
  }
904
915
 
@@ -1209,8 +1220,8 @@ function scanNumber(parser, context, kind) {
1209
1220
  digits++;
1210
1221
  char = advanceChar(parser);
1211
1222
  }
1212
- if (digits < 1 || !allowSeparator) {
1213
- report(parser, digits < 1 ? 19 : 147);
1223
+ if (digits === 0 || !allowSeparator) {
1224
+ report(parser, digits === 0 ? 19 : 147);
1214
1225
  }
1215
1226
  }
1216
1227
  else if ((char | 32) === 111) {
@@ -1230,8 +1241,8 @@ function scanNumber(parser, context, kind) {
1230
1241
  digits++;
1231
1242
  char = advanceChar(parser);
1232
1243
  }
1233
- if (digits < 1 || !allowSeparator) {
1234
- report(parser, digits < 1 ? 0 : 147);
1244
+ if (digits === 0 || !allowSeparator) {
1245
+ report(parser, digits === 0 ? 0 : 147);
1235
1246
  }
1236
1247
  }
1237
1248
  else if ((char | 32) === 98) {
@@ -1251,8 +1262,8 @@ function scanNumber(parser, context, kind) {
1251
1262
  digits++;
1252
1263
  char = advanceChar(parser);
1253
1264
  }
1254
- if (digits < 1 || !allowSeparator) {
1255
- report(parser, digits < 1 ? 0 : 147);
1265
+ if (digits === 0 || !allowSeparator) {
1266
+ report(parser, digits === 0 ? 0 : 147);
1256
1267
  }
1257
1268
  }
1258
1269
  else if (CharTypes[char] & 32) {
@@ -1328,7 +1339,7 @@ function scanNumber(parser, context, kind) {
1328
1339
  if (CharTypes[char] & 256)
1329
1340
  char = advanceChar(parser);
1330
1341
  const { index } = parser;
1331
- if ((CharTypes[char] & 16) < 1)
1342
+ if ((CharTypes[char] & 16) === 0)
1332
1343
  report(parser, 10);
1333
1344
  value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
1334
1345
  char = parser.currentChar;
@@ -1502,14 +1513,28 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
1502
1513
  return 208897;
1503
1514
  if (!hasEscape)
1504
1515
  return token;
1516
+ if (token === 209008) {
1517
+ if ((context & (2048 | 4194304)) === 0) {
1518
+ return token;
1519
+ }
1520
+ return 121;
1521
+ }
1505
1522
  if (context & 1024) {
1506
- return token === 209008 && (context & (2048 | 4194304)) === 0
1507
- ? token
1508
- : token === 36972
1509
- ? 122
1510
- : (token & 36864) === 36864
1511
- ? 122
1512
- : 121;
1523
+ if (token === 36972) {
1524
+ return 122;
1525
+ }
1526
+ if ((token & 36864) === 36864) {
1527
+ return 122;
1528
+ }
1529
+ if ((token & 20480) === 20480) {
1530
+ if (context & 1073741824 && (context & 8192) === 0) {
1531
+ return token;
1532
+ }
1533
+ else {
1534
+ return 121;
1535
+ }
1536
+ }
1537
+ return 143483;
1513
1538
  }
1514
1539
  if (context & 1073741824 &&
1515
1540
  (context & 8192) === 0 &&
@@ -1522,13 +1547,13 @@ function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {
1522
1547
  ? 121
1523
1548
  : token;
1524
1549
  }
1525
- return token === 209007 && context & 1073741824
1526
- ? 143483
1527
- : (token & 36864) === 36864
1528
- ? token
1529
- : token === 209008 && (context & 4194304) === 0
1530
- ? token
1531
- : 121;
1550
+ if (token === 209007) {
1551
+ return 143483;
1552
+ }
1553
+ if ((token & 36864) === 36864) {
1554
+ return token;
1555
+ }
1556
+ return 121;
1532
1557
  }
1533
1558
  return 208897;
1534
1559
  }
@@ -1791,7 +1816,7 @@ function scanSingleToken(parser, context, state) {
1791
1816
  }
1792
1817
  else if (ch === 61) {
1793
1818
  advanceChar(parser);
1794
- return 8456000;
1819
+ return 8456256;
1795
1820
  }
1796
1821
  if (ch === 33) {
1797
1822
  const index = parser.index + 1;
@@ -1809,7 +1834,7 @@ function scanSingleToken(parser, context, state) {
1809
1834
  return 8456258;
1810
1835
  }
1811
1836
  if (ch === 47) {
1812
- if ((context & 16) < 1)
1837
+ if ((context & 16) === 0)
1813
1838
  return 8456258;
1814
1839
  const index = parser.index + 1;
1815
1840
  if (index < parser.end) {
@@ -1974,7 +1999,7 @@ function scanSingleToken(parser, context, state) {
1974
1999
  const ch = parser.currentChar;
1975
2000
  if (ch === 61) {
1976
2001
  advanceChar(parser);
1977
- return 8456001;
2002
+ return 8456257;
1978
2003
  }
1979
2004
  if (ch !== 62)
1980
2005
  return 8456259;
@@ -4915,7 +4940,7 @@ function parseStatement(parser, context, scope, origin, labels, allowFuncDecl, s
4915
4940
  case 86106:
4916
4941
  report(parser, context & 1024
4917
4942
  ? 73
4918
- : (context & 256) < 1
4943
+ : (context & 256) === 0
4919
4944
  ? 75
4920
4945
  : 74);
4921
4946
  case 86096:
@@ -4961,12 +4986,12 @@ function parseBlock(parser, context, scope, labels, start, line, column) {
4961
4986
  });
4962
4987
  }
4963
4988
  function parseReturnStatement(parser, context, start, line, column) {
4964
- if ((context & 32) < 1 && context & 8192)
4989
+ if ((context & 32) === 0 && context & 8192)
4965
4990
  report(parser, 89);
4966
4991
  nextToken(parser, context | 32768);
4967
4992
  const argument = parser.flags & 1 || parser.token & 1048576
4968
4993
  ? null
4969
- : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.line, parser.column);
4994
+ : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
4970
4995
  matchOrInsertSemicolon(parser, context | 32768);
4971
4996
  return finishNode(parser, context, start, line, column, {
4972
4997
  type: 'ReturnStatement',
@@ -4985,7 +5010,7 @@ function parseLabelledStatement(parser, context, scope, origin, labels, value, e
4985
5010
  validateAndDeclareLabel(parser, labels, value);
4986
5011
  nextToken(parser, context | 32768);
4987
5012
  const body = allowFuncDecl &&
4988
- (context & 1024) < 1 &&
5013
+ (context & 1024) === 0 &&
4989
5014
  context & 256 &&
4990
5015
  parser.token === 86106
4991
5016
  ? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
@@ -5094,7 +5119,7 @@ function parseIfStatement(parser, context, scope, labels, start, line, column) {
5094
5119
  }
5095
5120
  function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
5096
5121
  return context & 1024 ||
5097
- (context & 256) < 1 ||
5122
+ (context & 256) === 0 ||
5098
5123
  parser.token !== 86106
5099
5124
  ? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
5100
5125
  : parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
@@ -5159,11 +5184,11 @@ function parseIterationStatementBody(parser, context, scope, labels) {
5159
5184
  return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
5160
5185
  }
5161
5186
  function parseContinueStatement(parser, context, labels, start, line, column) {
5162
- if ((context & 131072) < 1)
5187
+ if ((context & 131072) === 0)
5163
5188
  report(parser, 65);
5164
5189
  nextToken(parser, context);
5165
5190
  let label = null;
5166
- if ((parser.flags & 1) < 1 && parser.token & 143360) {
5191
+ if ((parser.flags & 1) === 0 && parser.token & 143360) {
5167
5192
  const { tokenValue } = parser;
5168
5193
  label = parseIdentifier(parser, context | 32768, 0);
5169
5194
  if (!isValidLabel(parser, labels, tokenValue, 1))
@@ -5178,13 +5203,13 @@ function parseContinueStatement(parser, context, labels, start, line, column) {
5178
5203
  function parseBreakStatement(parser, context, labels, start, line, column) {
5179
5204
  nextToken(parser, context | 32768);
5180
5205
  let label = null;
5181
- if ((parser.flags & 1) < 1 && parser.token & 143360) {
5206
+ if ((parser.flags & 1) === 0 && parser.token & 143360) {
5182
5207
  const { tokenValue } = parser;
5183
5208
  label = parseIdentifier(parser, context | 32768, 0);
5184
5209
  if (!isValidLabel(parser, labels, tokenValue, 0))
5185
5210
  report(parser, 134, tokenValue);
5186
5211
  }
5187
- else if ((context & (4096 | 131072)) < 1) {
5212
+ else if ((context & (4096 | 131072)) === 0) {
5188
5213
  report(parser, 66);
5189
5214
  }
5190
5215
  matchOrInsertSemicolon(parser, context | 32768);
@@ -5264,6 +5289,17 @@ function parseCatchBlock(parser, context, scope, labels, start, line, column) {
5264
5289
  body
5265
5290
  });
5266
5291
  }
5292
+ function parseStaticBlock(parser, context, scope, start, line, column) {
5293
+ if (scope)
5294
+ scope = addChildScope(scope, 2);
5295
+ const ctorContext = 16384 | 524288;
5296
+ context = ((context | ctorContext) ^ ctorContext) | 262144;
5297
+ const { body } = parseBlock(parser, context, scope, {}, start, line, column);
5298
+ return finishNode(parser, context, start, line, column, {
5299
+ type: 'StaticBlock',
5300
+ body
5301
+ });
5302
+ }
5267
5303
  function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
5268
5304
  nextToken(parser, context | 32768);
5269
5305
  const body = parseIterationStatementBody(parser, context, scope, labels);
@@ -5351,10 +5387,10 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
5351
5387
  if (parser.token === 1077936157) {
5352
5388
  nextToken(parser, context | 32768);
5353
5389
  init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
5354
- if (origin & 32 || (token & 2097152) < 1) {
5390
+ if (origin & 32 || (token & 2097152) === 0) {
5355
5391
  if (parser.token === 274549 ||
5356
5392
  (parser.token === 8738868 &&
5357
- (token & 2097152 || (kind & 4) < 1 || context & 1024))) {
5393
+ (token & 2097152 || (kind & 4) === 0 || context & 1024))) {
5358
5394
  reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
5359
5395
  }
5360
5396
  }
@@ -5371,7 +5407,8 @@ function parseVariableDeclaration(parser, context, scope, kind, origin) {
5371
5407
  }
5372
5408
  function parseForStatement(parser, context, scope, labels, start, line, column) {
5373
5409
  nextToken(parser, context);
5374
- const forAwait = (context & 4194304) > 0 && consumeOpt(parser, context, 209008);
5410
+ const forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
5411
+ consumeOpt(parser, context, 209008);
5375
5412
  consume(parser, context | 32768, 67174411);
5376
5413
  if (scope)
5377
5414
  scope = addChildScope(scope, 1);
@@ -5660,7 +5697,7 @@ function parseExportDeclaration(parser, context, scope) {
5660
5697
  const { tokenPos, linePos, colPos } = parser;
5661
5698
  declaration = parseIdentifier(parser, context, 0);
5662
5699
  const { flags } = parser;
5663
- if ((flags & 1) < 1) {
5700
+ if ((flags & 1) === 0) {
5664
5701
  if (parser.token === 86106) {
5665
5702
  declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
5666
5703
  }
@@ -5784,7 +5821,7 @@ function parseExportDeclaration(parser, context, scope) {
5784
5821
  case 209007:
5785
5822
  const { tokenPos, linePos, colPos } = parser;
5786
5823
  nextToken(parser, context);
5787
- if ((parser.flags & 1) < 1 && parser.token === 86106) {
5824
+ if ((parser.flags & 1) === 0 && parser.token === 86106) {
5788
5825
  declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
5789
5826
  if (scope) {
5790
5827
  key = declaration.id ? declaration.id.name : '';
@@ -5941,7 +5978,7 @@ function parseAsyncExpression(parser, context, inGroup, isLHS, canAssign, isPatt
5941
5978
  const { token } = parser;
5942
5979
  const expr = parseIdentifier(parser, context, isPattern);
5943
5980
  const { flags } = parser;
5944
- if ((flags & 1) < 1) {
5981
+ if ((flags & 1) === 0) {
5945
5982
  if (parser.token === 86106) {
5946
5983
  return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
5947
5984
  }
@@ -5975,7 +6012,7 @@ function parseYieldExpression(parser, context, inGroup, canAssign, start, line,
5975
6012
  report(parser, 120);
5976
6013
  let argument = null;
5977
6014
  let delegate = false;
5978
- if ((parser.flags & 1) < 1) {
6015
+ if ((parser.flags & 1) === 0) {
5979
6016
  delegate = consumeOpt(parser, context | 32768, 8457014);
5980
6017
  if (parser.token & (12288 | 65536) || delegate) {
5981
6018
  argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
@@ -6052,8 +6089,8 @@ function parseFunctionBody(parser, context, scope, origin, firstRestricted, scop
6052
6089
  if (context & 64 &&
6053
6090
  scope &&
6054
6091
  scopeError !== void 0 &&
6055
- (prevContext & 1024) < 1 &&
6056
- (context & 8192) < 1) {
6092
+ (prevContext & 1024) === 0 &&
6093
+ (context & 8192) === 0) {
6057
6094
  reportScopeError(scopeError);
6058
6095
  }
6059
6096
  }
@@ -6079,19 +6116,19 @@ function parseSuperExpression(parser, context, start, line, column) {
6079
6116
  case 67108991:
6080
6117
  report(parser, 161);
6081
6118
  case 67174411: {
6082
- if ((context & 524288) < 1)
6119
+ if ((context & 524288) === 0)
6083
6120
  report(parser, 26);
6084
6121
  if (context & 16384)
6085
- report(parser, 143);
6122
+ report(parser, 27);
6086
6123
  parser.assignable = 2;
6087
6124
  break;
6088
6125
  }
6089
6126
  case 69271571:
6090
6127
  case 67108877: {
6091
- if ((context & 262144) < 1)
6128
+ if ((context & 262144) === 0)
6092
6129
  report(parser, 27);
6093
6130
  if (context & 16384)
6094
- report(parser, 143);
6131
+ report(parser, 27);
6095
6132
  parser.assignable = 1;
6096
6133
  break;
6097
6134
  }
@@ -6118,14 +6155,14 @@ function parseUpdateExpression(parser, context, expr, start, line, column) {
6118
6155
  });
6119
6156
  }
6120
6157
  function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain, start, line, column) {
6121
- if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) < 1) {
6158
+ if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) === 0) {
6122
6159
  expr = parseUpdateExpression(parser, context, expr, start, line, column);
6123
6160
  }
6124
6161
  else if ((parser.token & 67108864) === 67108864) {
6125
- context = (context | 134217728 | 8192) ^ (134217728 | 8192);
6162
+ context = (context | 134217728) ^ 134217728;
6126
6163
  switch (parser.token) {
6127
6164
  case 67108877: {
6128
- nextToken(parser, context | 1073741824);
6165
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6129
6166
  parser.assignable = 1;
6130
6167
  const property = parsePropertyOrPrivatePropertyName(parser, context);
6131
6168
  expr = finishNode(parser, context, start, line, column, {
@@ -6181,7 +6218,7 @@ function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain,
6181
6218
  break;
6182
6219
  }
6183
6220
  case 67108991: {
6184
- nextToken(parser, context);
6221
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6185
6222
  parser.flags |= 2048;
6186
6223
  parser.assignable = 2;
6187
6224
  expr = parseOptionalChain(parser, context, expr, start, line, column);
@@ -6245,7 +6282,7 @@ function parseOptionalChain(parser, context, expr, start, line, column) {
6245
6282
  });
6246
6283
  }
6247
6284
  else {
6248
- if ((parser.token & (143360 | 4096)) < 1)
6285
+ if ((parser.token & (143360 | 4096)) === 0)
6249
6286
  report(parser, 154);
6250
6287
  const property = parseIdentifier(parser, context, 0);
6251
6288
  parser.assignable = 2;
@@ -6263,7 +6300,7 @@ function parseOptionalChain(parser, context, expr, start, line, column) {
6263
6300
  return node;
6264
6301
  }
6265
6302
  function parsePropertyOrPrivatePropertyName(parser, context) {
6266
- if ((parser.token & (143360 | 4096)) < 1 && parser.token !== 131) {
6303
+ if ((parser.token & (143360 | 4096)) === 0 && parser.token !== 131) {
6267
6304
  report(parser, 154);
6268
6305
  }
6269
6306
  return context & 1 && parser.token === 131
@@ -6588,11 +6625,11 @@ function parseFunctionDeclaration(parser, context, scope, origin, allowGen, flag
6588
6625
  let firstRestricted;
6589
6626
  let functionScope = scope ? createScope() : void 0;
6590
6627
  if (parser.token === 67174411) {
6591
- if ((flags & 1) < 1)
6628
+ if ((flags & 1) === 0)
6592
6629
  report(parser, 37, 'Function');
6593
6630
  }
6594
6631
  else {
6595
- const kind = origin & 4 && ((context & 8192) < 1 || (context & 2048) < 1)
6632
+ const kind = origin & 4 && ((context & 8192) === 0 || (context & 2048) === 0)
6596
6633
  ? 4
6597
6634
  : 64;
6598
6635
  validateFunctionName(parser, context | ((context & 3072) << 11), parser.token);
@@ -6738,7 +6775,7 @@ function parseArrayExpressionOrPattern(parser, context, scope, skipInitializer,
6738
6775
  destructible |=
6739
6776
  kind & 1
6740
6777
  ? 32
6741
- : (kind & 2) < 1
6778
+ : (kind & 2) === 0
6742
6779
  ? 16
6743
6780
  : 0;
6744
6781
  left = parseMemberOrUpdateExpression(parser, context, left, inGroup, 0, tokenPos, linePos, colPos);
@@ -6797,7 +6834,7 @@ function parseArrayExpressionOrPattern(parser, context, scope, skipInitializer,
6797
6834
  left = parseLeftHandSideExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
6798
6835
  if (parser.token !== 18 && parser.token !== 20) {
6799
6836
  left = parseAssignmentExpression(parser, context, inGroup, isPattern, tokenPos, linePos, colPos, left);
6800
- if ((kind & (2 | 1)) < 1 && token === 67174411)
6837
+ if ((kind & (2 | 1)) === 0 && token === 67174411)
6801
6838
  destructible |= 16;
6802
6839
  }
6803
6840
  else if (parser.assignable & 2) {
@@ -6986,7 +7023,7 @@ function parseSpreadOrRestElement(parser, context, scope, closingToken, kind, or
6986
7023
  });
6987
7024
  }
6988
7025
  function parseMethodDefinition(parser, context, kind, inGroup, start, line, column) {
6989
- const modifierFlags = (kind & 64) < 1 ? 31981568 : 14680064;
7026
+ const modifierFlags = (kind & 64) === 0 ? 31981568 : 14680064;
6990
7027
  context =
6991
7028
  ((context | modifierFlags) ^ modifierFlags) |
6992
7029
  ((kind & 88) << 18) |
@@ -7554,7 +7591,7 @@ function parseMethodFormals(parser, context, scope, kind, type, inGroup) {
7554
7591
  let left = null;
7555
7592
  const { tokenPos, linePos, colPos } = parser;
7556
7593
  if (parser.token & 143360) {
7557
- if ((context & 1024) < 1) {
7594
+ if ((context & 1024) === 0) {
7558
7595
  if ((parser.token & 36864) === 36864) {
7559
7596
  parser.flags |= 256;
7560
7597
  }
@@ -7815,7 +7852,7 @@ function parseArrowFunctionExpression(parser, context, scope, params, isAsync, s
7815
7852
  (134221824 | 8192 | 16384), scope, 16, void 0, void 0);
7816
7853
  switch (parser.token) {
7817
7854
  case 69271571:
7818
- if ((parser.flags & 1) < 1) {
7855
+ if ((parser.flags & 1) === 0) {
7819
7856
  report(parser, 112);
7820
7857
  }
7821
7858
  break;
@@ -7824,13 +7861,13 @@ function parseArrowFunctionExpression(parser, context, scope, params, isAsync, s
7824
7861
  case 22:
7825
7862
  report(parser, 113);
7826
7863
  case 67174411:
7827
- if ((parser.flags & 1) < 1) {
7864
+ if ((parser.flags & 1) === 0) {
7828
7865
  report(parser, 112);
7829
7866
  }
7830
7867
  parser.flags |= 1024;
7831
7868
  break;
7832
7869
  }
7833
- if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) < 1)
7870
+ if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) === 0)
7834
7871
  report(parser, 28, KeywordDescTable[parser.token & 255]);
7835
7872
  if ((parser.token & 33619968) === 33619968)
7836
7873
  report(parser, 121);
@@ -7856,7 +7893,7 @@ function parseFormalParametersOrFormalList(parser, context, scope, inGroup, kind
7856
7893
  let left;
7857
7894
  const { tokenPos, linePos, colPos } = parser;
7858
7895
  if (parser.token & 143360) {
7859
- if ((context & 1024) < 1) {
7896
+ if ((context & 1024) === 0) {
7860
7897
  if ((parser.token & 36864) === 36864) {
7861
7898
  parser.flags |= 256;
7862
7899
  }
@@ -8176,7 +8213,7 @@ function parseClassDeclaration(parser, context, scope, flags, start, line, colum
8176
8213
  id = parseIdentifier(parser, context, 0);
8177
8214
  }
8178
8215
  else {
8179
- if ((flags & 1) < 1)
8216
+ if ((flags & 1) === 0)
8180
8217
  report(parser, 37, 'Class');
8181
8218
  }
8182
8219
  let inheritedContext = context;
@@ -8307,7 +8344,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
8307
8344
  }
8308
8345
  break;
8309
8346
  case 209007:
8310
- if (parser.token !== 67174411 && (parser.flags & 1) < 1) {
8347
+ if (parser.token !== 67174411 && (parser.flags & 1) === 0) {
8311
8348
  if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8312
8349
  return parsePropertyDefinition(parser, context, key, kind, decorators, tokenPos, linePos, colPos);
8313
8350
  }
@@ -8345,12 +8382,13 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
8345
8382
  }
8346
8383
  else if (context & 1 && parser.token === 131) {
8347
8384
  kind |= 4096;
8348
- key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
8349
- context = context | 16384;
8385
+ key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
8350
8386
  }
8351
8387
  else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8352
8388
  kind |= 128;
8353
- context = context | 16384;
8389
+ }
8390
+ else if (isStatic && token === 2162700) {
8391
+ return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
8354
8392
  }
8355
8393
  else if (token === 122) {
8356
8394
  key = parseIdentifier(parser, context, 0);
@@ -8381,16 +8419,16 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
8381
8419
  else
8382
8420
  report(parser, 131);
8383
8421
  }
8384
- if ((kind & 2) < 1) {
8422
+ if ((kind & 2) === 0) {
8385
8423
  if (parser.tokenValue === 'constructor') {
8386
8424
  if ((parser.token & 1073741824) === 1073741824) {
8387
8425
  report(parser, 125);
8388
8426
  }
8389
- else if ((kind & 32) < 1 && parser.token === 67174411) {
8427
+ else if ((kind & 32) === 0 && parser.token === 67174411) {
8390
8428
  if (kind & (768 | 16 | 128 | 8)) {
8391
8429
  report(parser, 50, 'accessor');
8392
8430
  }
8393
- else if ((context & 524288) < 1) {
8431
+ else if ((context & 524288) === 0) {
8394
8432
  if (parser.flags & 32)
8395
8433
  report(parser, 51);
8396
8434
  else
@@ -8399,7 +8437,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
8399
8437
  }
8400
8438
  kind |= 64;
8401
8439
  }
8402
- else if ((kind & 4096) < 1 &&
8440
+ else if ((kind & 4096) === 0 &&
8403
8441
  kind & (32 | 768 | 8 | 16) &&
8404
8442
  parser.tokenValue === 'prototype') {
8405
8443
  report(parser, 49);
@@ -8412,7 +8450,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
8412
8450
  return finishNode(parser, context, start, line, column, context & 1
8413
8451
  ? {
8414
8452
  type: 'MethodDefinition',
8415
- kind: (kind & 32) < 1 && kind & 64
8453
+ kind: (kind & 32) === 0 && kind & 64
8416
8454
  ? 'constructor'
8417
8455
  : kind & 256
8418
8456
  ? 'get'
@@ -8427,7 +8465,7 @@ function parseClassElementList(parser, context, scope, inheritedContext, type, d
8427
8465
  }
8428
8466
  : {
8429
8467
  type: 'MethodDefinition',
8430
- kind: (kind & 32) < 1 && kind & 64
8468
+ kind: (kind & 32) === 0 && kind & 64
8431
8469
  ? 'constructor'
8432
8470
  : kind & 256
8433
8471
  ? 'get'
@@ -8716,7 +8754,7 @@ function parseJSXNamespacedName(parser, context, namespace, start, line, column)
8716
8754
  });
8717
8755
  }
8718
8756
  function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
8719
- nextToken(parser, context);
8757
+ nextToken(parser, context | 32768);
8720
8758
  const { tokenPos, linePos, colPos } = parser;
8721
8759
  if (parser.token === 14)
8722
8760
  return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
@@ -8770,7 +8808,7 @@ var estree = /*#__PURE__*/Object.freeze({
8770
8808
  __proto__: null
8771
8809
  });
8772
8810
 
8773
- var version$1 = "4.2.0";
8811
+ var version$1 = "4.3.1";
8774
8812
 
8775
8813
  const version = version$1;
8776
8814
  function parseScript(source, options) {