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.
@@ -2,9 +2,9 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.meriyah = {}));
5
- }(this, (function (exports) { 'use strict';
5
+ })(this, (function (exports) { 'use strict';
6
6
 
7
- /*! *****************************************************************************
7
+ /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
9
9
 
10
10
  Permission to use, copy, modify, and/or distribute this software for any
@@ -35,10 +35,14 @@
35
35
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
36
  }
37
37
 
38
- function __spreadArray(to, from) {
39
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
40
- to[j] = from[i];
41
- return to;
38
+ function __spreadArray(to, from, pack) {
39
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40
+ if (ar || !(i in from)) {
41
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42
+ ar[i] = from[i];
43
+ }
44
+ }
45
+ return to.concat(ar || Array.prototype.slice.call(from));
42
46
  }
43
47
 
44
48
  var _a;
@@ -216,7 +220,7 @@
216
220
  }
217
221
  var _this = this;
218
222
  var message = '[' + line + ':' + column + ']: ' + errorMessages[type].replace(/%(\d+)/g, function (_, i) { return params[i]; });
219
- _this = _super.call(this, "" + message) || this;
223
+ _this = _super.call(this, "".concat(message)) || this;
220
224
  _this.index = startindex;
221
225
  _this.line = line;
222
226
  _this.column = column;
@@ -234,7 +238,7 @@
234
238
  for (var _i = 2; _i < arguments.length; _i++) {
235
239
  params[_i - 2] = arguments[_i];
236
240
  }
237
- throw new (ParseError.bind.apply(ParseError, __spreadArray([void 0, parser.index, parser.line, parser.column, type], params)))();
241
+ throw new (ParseError.bind.apply(ParseError, __spreadArray([void 0, parser.index, parser.line, parser.column, type], params, false)))();
238
242
  }
239
243
  function reportScopeError(scope) {
240
244
  throw new ParseError(scope.index, scope.line, scope.column, scope.type, scope.params);
@@ -244,7 +248,7 @@
244
248
  for (var _i = 4; _i < arguments.length; _i++) {
245
249
  params[_i - 4] = arguments[_i];
246
250
  }
247
- throw new (ParseError.bind.apply(ParseError, __spreadArray([void 0, index, line, column, type], params)))();
251
+ throw new (ParseError.bind.apply(ParseError, __spreadArray([void 0, index, line, column, type], params, false)))();
248
252
  }
249
253
  function reportScannerError(index, line, column, type) {
250
254
  throw new ParseError(index, line, column, type);
@@ -923,7 +927,7 @@
923
927
  break;
924
928
  case 117:
925
929
  if (mask & 16)
926
- report(parser, 34, 'g');
930
+ report(parser, 34, 'u');
927
931
  mask |= 16;
928
932
  break;
929
933
  case 121:
@@ -932,9 +936,14 @@
932
936
  mask |= 8;
933
937
  break;
934
938
  case 115:
935
- if (mask & 12)
939
+ if (mask & 32)
936
940
  report(parser, 34, 's');
937
- mask |= 12;
941
+ mask |= 32;
942
+ break;
943
+ case 100:
944
+ if (mask & 64)
945
+ report(parser, 34, 'd');
946
+ mask |= 64;
938
947
  break;
939
948
  default:
940
949
  report(parser, 33);
@@ -954,7 +963,13 @@
954
963
  return new RegExp(pattern, flags);
955
964
  }
956
965
  catch (e) {
957
- report(parser, 32);
966
+ try {
967
+ new RegExp(pattern, flags.replace('d', ''));
968
+ return null;
969
+ }
970
+ catch (e) {
971
+ report(parser, 32);
972
+ }
958
973
  }
959
974
  }
960
975
 
@@ -1265,8 +1280,8 @@
1265
1280
  digits++;
1266
1281
  char = advanceChar(parser);
1267
1282
  }
1268
- if (digits < 1 || !allowSeparator) {
1269
- report(parser, digits < 1 ? 19 : 147);
1283
+ if (digits === 0 || !allowSeparator) {
1284
+ report(parser, digits === 0 ? 19 : 147);
1270
1285
  }
1271
1286
  }
1272
1287
  else if ((char | 32) === 111) {
@@ -1286,8 +1301,8 @@
1286
1301
  digits++;
1287
1302
  char = advanceChar(parser);
1288
1303
  }
1289
- if (digits < 1 || !allowSeparator) {
1290
- report(parser, digits < 1 ? 0 : 147);
1304
+ if (digits === 0 || !allowSeparator) {
1305
+ report(parser, digits === 0 ? 0 : 147);
1291
1306
  }
1292
1307
  }
1293
1308
  else if ((char | 32) === 98) {
@@ -1307,8 +1322,8 @@
1307
1322
  digits++;
1308
1323
  char = advanceChar(parser);
1309
1324
  }
1310
- if (digits < 1 || !allowSeparator) {
1311
- report(parser, digits < 1 ? 0 : 147);
1325
+ if (digits === 0 || !allowSeparator) {
1326
+ report(parser, digits === 0 ? 0 : 147);
1312
1327
  }
1313
1328
  }
1314
1329
  else if (CharTypes[char] & 32) {
@@ -1384,7 +1399,7 @@
1384
1399
  if (CharTypes[char] & 256)
1385
1400
  char = advanceChar(parser);
1386
1401
  var index = parser.index;
1387
- if ((CharTypes[char] & 16) < 1)
1402
+ if ((CharTypes[char] & 16) === 0)
1388
1403
  report(parser, 10);
1389
1404
  value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
1390
1405
  char = parser.currentChar;
@@ -1558,14 +1573,28 @@
1558
1573
  return 208897;
1559
1574
  if (!hasEscape)
1560
1575
  return token;
1576
+ if (token === 209008) {
1577
+ if ((context & (2048 | 4194304)) === 0) {
1578
+ return token;
1579
+ }
1580
+ return 121;
1581
+ }
1561
1582
  if (context & 1024) {
1562
- return token === 209008 && (context & (2048 | 4194304)) === 0
1563
- ? token
1564
- : token === 36972
1565
- ? 122
1566
- : (token & 36864) === 36864
1567
- ? 122
1568
- : 121;
1583
+ if (token === 36972) {
1584
+ return 122;
1585
+ }
1586
+ if ((token & 36864) === 36864) {
1587
+ return 122;
1588
+ }
1589
+ if ((token & 20480) === 20480) {
1590
+ if (context & 1073741824 && (context & 8192) === 0) {
1591
+ return token;
1592
+ }
1593
+ else {
1594
+ return 121;
1595
+ }
1596
+ }
1597
+ return 143483;
1569
1598
  }
1570
1599
  if (context & 1073741824 &&
1571
1600
  (context & 8192) === 0 &&
@@ -1578,13 +1607,13 @@
1578
1607
  ? 121
1579
1608
  : token;
1580
1609
  }
1581
- return token === 209007 && context & 1073741824
1582
- ? 143483
1583
- : (token & 36864) === 36864
1584
- ? token
1585
- : token === 209008 && (context & 4194304) === 0
1586
- ? token
1587
- : 121;
1610
+ if (token === 209007) {
1611
+ return 143483;
1612
+ }
1613
+ if ((token & 36864) === 36864) {
1614
+ return token;
1615
+ }
1616
+ return 121;
1588
1617
  }
1589
1618
  return 208897;
1590
1619
  }
@@ -1847,7 +1876,7 @@
1847
1876
  }
1848
1877
  else if (ch === 61) {
1849
1878
  advanceChar(parser);
1850
- return 8456000;
1879
+ return 8456256;
1851
1880
  }
1852
1881
  if (ch === 33) {
1853
1882
  var index = parser.index + 1;
@@ -1865,7 +1894,7 @@
1865
1894
  return 8456258;
1866
1895
  }
1867
1896
  if (ch === 47) {
1868
- if ((context & 16) < 1)
1897
+ if ((context & 16) === 0)
1869
1898
  return 8456258;
1870
1899
  var index = parser.index + 1;
1871
1900
  if (index < parser.end) {
@@ -2030,7 +2059,7 @@
2030
2059
  var ch_7 = parser.currentChar;
2031
2060
  if (ch_7 === 61) {
2032
2061
  advanceChar(parser);
2033
- return 8456001;
2062
+ return 8456257;
2034
2063
  }
2035
2064
  if (ch_7 !== 62)
2036
2065
  return 8456259;
@@ -4975,7 +5004,7 @@
4975
5004
  case 86106:
4976
5005
  report(parser, context & 1024
4977
5006
  ? 73
4978
- : (context & 256) < 1
5007
+ : (context & 256) === 0
4979
5008
  ? 75
4980
5009
  : 74);
4981
5010
  case 86096:
@@ -5021,12 +5050,12 @@
5021
5050
  });
5022
5051
  }
5023
5052
  function parseReturnStatement(parser, context, start, line, column) {
5024
- if ((context & 32) < 1 && context & 8192)
5053
+ if ((context & 32) === 0 && context & 8192)
5025
5054
  report(parser, 89);
5026
5055
  nextToken(parser, context | 32768);
5027
5056
  var argument = parser.flags & 1 || parser.token & 1048576
5028
5057
  ? null
5029
- : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.line, parser.column);
5058
+ : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
5030
5059
  matchOrInsertSemicolon(parser, context | 32768);
5031
5060
  return finishNode(parser, context, start, line, column, {
5032
5061
  type: 'ReturnStatement',
@@ -5045,7 +5074,7 @@
5045
5074
  validateAndDeclareLabel(parser, labels, value);
5046
5075
  nextToken(parser, context | 32768);
5047
5076
  var body = allowFuncDecl &&
5048
- (context & 1024) < 1 &&
5077
+ (context & 1024) === 0 &&
5049
5078
  context & 256 &&
5050
5079
  parser.token === 86106
5051
5080
  ? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
@@ -5154,7 +5183,7 @@
5154
5183
  }
5155
5184
  function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
5156
5185
  return context & 1024 ||
5157
- (context & 256) < 1 ||
5186
+ (context & 256) === 0 ||
5158
5187
  parser.token !== 86106
5159
5188
  ? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
5160
5189
  : parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
@@ -5219,11 +5248,11 @@
5219
5248
  return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
5220
5249
  }
5221
5250
  function parseContinueStatement(parser, context, labels, start, line, column) {
5222
- if ((context & 131072) < 1)
5251
+ if ((context & 131072) === 0)
5223
5252
  report(parser, 65);
5224
5253
  nextToken(parser, context);
5225
5254
  var label = null;
5226
- if ((parser.flags & 1) < 1 && parser.token & 143360) {
5255
+ if ((parser.flags & 1) === 0 && parser.token & 143360) {
5227
5256
  var tokenValue = parser.tokenValue;
5228
5257
  label = parseIdentifier(parser, context | 32768, 0);
5229
5258
  if (!isValidLabel(parser, labels, tokenValue, 1))
@@ -5238,13 +5267,13 @@
5238
5267
  function parseBreakStatement(parser, context, labels, start, line, column) {
5239
5268
  nextToken(parser, context | 32768);
5240
5269
  var label = null;
5241
- if ((parser.flags & 1) < 1 && parser.token & 143360) {
5270
+ if ((parser.flags & 1) === 0 && parser.token & 143360) {
5242
5271
  var tokenValue = parser.tokenValue;
5243
5272
  label = parseIdentifier(parser, context | 32768, 0);
5244
5273
  if (!isValidLabel(parser, labels, tokenValue, 0))
5245
5274
  report(parser, 134, tokenValue);
5246
5275
  }
5247
- else if ((context & (4096 | 131072)) < 1) {
5276
+ else if ((context & (4096 | 131072)) === 0) {
5248
5277
  report(parser, 66);
5249
5278
  }
5250
5279
  matchOrInsertSemicolon(parser, context | 32768);
@@ -5324,6 +5353,17 @@
5324
5353
  body: body
5325
5354
  });
5326
5355
  }
5356
+ function parseStaticBlock(parser, context, scope, start, line, column) {
5357
+ if (scope)
5358
+ scope = addChildScope(scope, 2);
5359
+ var ctorContext = 16384 | 524288;
5360
+ context = ((context | ctorContext) ^ ctorContext) | 262144;
5361
+ var body = parseBlock(parser, context, scope, {}, start, line, column).body;
5362
+ return finishNode(parser, context, start, line, column, {
5363
+ type: 'StaticBlock',
5364
+ body: body
5365
+ });
5366
+ }
5327
5367
  function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
5328
5368
  nextToken(parser, context | 32768);
5329
5369
  var body = parseIterationStatementBody(parser, context, scope, labels);
@@ -5411,10 +5451,10 @@
5411
5451
  if (parser.token === 1077936157) {
5412
5452
  nextToken(parser, context | 32768);
5413
5453
  init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
5414
- if (origin & 32 || (token & 2097152) < 1) {
5454
+ if (origin & 32 || (token & 2097152) === 0) {
5415
5455
  if (parser.token === 274549 ||
5416
5456
  (parser.token === 8738868 &&
5417
- (token & 2097152 || (kind & 4) < 1 || context & 1024))) {
5457
+ (token & 2097152 || (kind & 4) === 0 || context & 1024))) {
5418
5458
  reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
5419
5459
  }
5420
5460
  }
@@ -5431,7 +5471,8 @@
5431
5471
  }
5432
5472
  function parseForStatement(parser, context, scope, labels, start, line, column) {
5433
5473
  nextToken(parser, context);
5434
- var forAwait = (context & 4194304) > 0 && consumeOpt(parser, context, 209008);
5474
+ var forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
5475
+ consumeOpt(parser, context, 209008);
5435
5476
  consume(parser, context | 32768, 67174411);
5436
5477
  if (scope)
5437
5478
  scope = addChildScope(scope, 1);
@@ -5720,7 +5761,7 @@
5720
5761
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
5721
5762
  declaration = parseIdentifier(parser, context, 0);
5722
5763
  var flags = parser.flags;
5723
- if ((flags & 1) < 1) {
5764
+ if ((flags & 1) === 0) {
5724
5765
  if (parser.token === 86106) {
5725
5766
  declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
5726
5767
  }
@@ -5844,7 +5885,7 @@
5844
5885
  case 209007:
5845
5886
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
5846
5887
  nextToken(parser, context);
5847
- if ((parser.flags & 1) < 1 && parser.token === 86106) {
5888
+ if ((parser.flags & 1) === 0 && parser.token === 86106) {
5848
5889
  declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
5849
5890
  if (scope) {
5850
5891
  key = declaration.id ? declaration.id.name : '';
@@ -6001,7 +6042,7 @@
6001
6042
  var token = parser.token;
6002
6043
  var expr = parseIdentifier(parser, context, isPattern);
6003
6044
  var flags = parser.flags;
6004
- if ((flags & 1) < 1) {
6045
+ if ((flags & 1) === 0) {
6005
6046
  if (parser.token === 86106) {
6006
6047
  return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
6007
6048
  }
@@ -6035,7 +6076,7 @@
6035
6076
  report(parser, 120);
6036
6077
  var argument = null;
6037
6078
  var delegate = false;
6038
- if ((parser.flags & 1) < 1) {
6079
+ if ((parser.flags & 1) === 0) {
6039
6080
  delegate = consumeOpt(parser, context | 32768, 8457014);
6040
6081
  if (parser.token & (12288 | 65536) || delegate) {
6041
6082
  argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
@@ -6112,8 +6153,8 @@
6112
6153
  if (context & 64 &&
6113
6154
  scope &&
6114
6155
  scopeError !== void 0 &&
6115
- (prevContext & 1024) < 1 &&
6116
- (context & 8192) < 1) {
6156
+ (prevContext & 1024) === 0 &&
6157
+ (context & 8192) === 0) {
6117
6158
  reportScopeError(scopeError);
6118
6159
  }
6119
6160
  }
@@ -6139,19 +6180,19 @@
6139
6180
  case 67108991:
6140
6181
  report(parser, 161);
6141
6182
  case 67174411: {
6142
- if ((context & 524288) < 1)
6183
+ if ((context & 524288) === 0)
6143
6184
  report(parser, 26);
6144
6185
  if (context & 16384)
6145
- report(parser, 143);
6186
+ report(parser, 27);
6146
6187
  parser.assignable = 2;
6147
6188
  break;
6148
6189
  }
6149
6190
  case 69271571:
6150
6191
  case 67108877: {
6151
- if ((context & 262144) < 1)
6192
+ if ((context & 262144) === 0)
6152
6193
  report(parser, 27);
6153
6194
  if (context & 16384)
6154
- report(parser, 143);
6195
+ report(parser, 27);
6155
6196
  parser.assignable = 1;
6156
6197
  break;
6157
6198
  }
@@ -6178,14 +6219,14 @@
6178
6219
  });
6179
6220
  }
6180
6221
  function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain, start, line, column) {
6181
- if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) < 1) {
6222
+ if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) === 0) {
6182
6223
  expr = parseUpdateExpression(parser, context, expr, start, line, column);
6183
6224
  }
6184
6225
  else if ((parser.token & 67108864) === 67108864) {
6185
- context = (context | 134217728 | 8192) ^ (134217728 | 8192);
6226
+ context = (context | 134217728) ^ 134217728;
6186
6227
  switch (parser.token) {
6187
6228
  case 67108877: {
6188
- nextToken(parser, context | 1073741824);
6229
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6189
6230
  parser.assignable = 1;
6190
6231
  var property = parsePropertyOrPrivatePropertyName(parser, context);
6191
6232
  expr = finishNode(parser, context, start, line, column, {
@@ -6241,7 +6282,7 @@
6241
6282
  break;
6242
6283
  }
6243
6284
  case 67108991: {
6244
- nextToken(parser, context);
6285
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6245
6286
  parser.flags |= 2048;
6246
6287
  parser.assignable = 2;
6247
6288
  expr = parseOptionalChain(parser, context, expr, start, line, column);
@@ -6305,7 +6346,7 @@
6305
6346
  });
6306
6347
  }
6307
6348
  else {
6308
- if ((parser.token & (143360 | 4096)) < 1)
6349
+ if ((parser.token & (143360 | 4096)) === 0)
6309
6350
  report(parser, 154);
6310
6351
  var property = parseIdentifier(parser, context, 0);
6311
6352
  parser.assignable = 2;
@@ -6323,7 +6364,7 @@
6323
6364
  return node;
6324
6365
  }
6325
6366
  function parsePropertyOrPrivatePropertyName(parser, context) {
6326
- if ((parser.token & (143360 | 4096)) < 1 && parser.token !== 131) {
6367
+ if ((parser.token & (143360 | 4096)) === 0 && parser.token !== 131) {
6327
6368
  report(parser, 154);
6328
6369
  }
6329
6370
  return context & 1 && parser.token === 131
@@ -6648,11 +6689,11 @@
6648
6689
  var firstRestricted;
6649
6690
  var functionScope = scope ? createScope() : void 0;
6650
6691
  if (parser.token === 67174411) {
6651
- if ((flags & 1) < 1)
6692
+ if ((flags & 1) === 0)
6652
6693
  report(parser, 37, 'Function');
6653
6694
  }
6654
6695
  else {
6655
- var kind = origin & 4 && ((context & 8192) < 1 || (context & 2048) < 1)
6696
+ var kind = origin & 4 && ((context & 8192) === 0 || (context & 2048) === 0)
6656
6697
  ? 4
6657
6698
  : 64;
6658
6699
  validateFunctionName(parser, context | ((context & 3072) << 11), parser.token);
@@ -6798,7 +6839,7 @@
6798
6839
  destructible |=
6799
6840
  kind & 1
6800
6841
  ? 32
6801
- : (kind & 2) < 1
6842
+ : (kind & 2) === 0
6802
6843
  ? 16
6803
6844
  : 0;
6804
6845
  left = parseMemberOrUpdateExpression(parser, context, left, inGroup, 0, tokenPos, linePos, colPos);
@@ -6857,7 +6898,7 @@
6857
6898
  left = parseLeftHandSideExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
6858
6899
  if (parser.token !== 18 && parser.token !== 20) {
6859
6900
  left = parseAssignmentExpression(parser, context, inGroup, isPattern, tokenPos, linePos, colPos, left);
6860
- if ((kind & (2 | 1)) < 1 && token === 67174411)
6901
+ if ((kind & (2 | 1)) === 0 && token === 67174411)
6861
6902
  destructible |= 16;
6862
6903
  }
6863
6904
  else if (parser.assignable & 2) {
@@ -7046,7 +7087,7 @@
7046
7087
  });
7047
7088
  }
7048
7089
  function parseMethodDefinition(parser, context, kind, inGroup, start, line, column) {
7049
- var modifierFlags = (kind & 64) < 1 ? 31981568 : 14680064;
7090
+ var modifierFlags = (kind & 64) === 0 ? 31981568 : 14680064;
7050
7091
  context =
7051
7092
  ((context | modifierFlags) ^ modifierFlags) |
7052
7093
  ((kind & 88) << 18) |
@@ -7614,7 +7655,7 @@
7614
7655
  var left = null;
7615
7656
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
7616
7657
  if (parser.token & 143360) {
7617
- if ((context & 1024) < 1) {
7658
+ if ((context & 1024) === 0) {
7618
7659
  if ((parser.token & 36864) === 36864) {
7619
7660
  parser.flags |= 256;
7620
7661
  }
@@ -7875,7 +7916,7 @@
7875
7916
  (134221824 | 8192 | 16384), scope, 16, void 0, void 0);
7876
7917
  switch (parser.token) {
7877
7918
  case 69271571:
7878
- if ((parser.flags & 1) < 1) {
7919
+ if ((parser.flags & 1) === 0) {
7879
7920
  report(parser, 112);
7880
7921
  }
7881
7922
  break;
@@ -7884,13 +7925,13 @@
7884
7925
  case 22:
7885
7926
  report(parser, 113);
7886
7927
  case 67174411:
7887
- if ((parser.flags & 1) < 1) {
7928
+ if ((parser.flags & 1) === 0) {
7888
7929
  report(parser, 112);
7889
7930
  }
7890
7931
  parser.flags |= 1024;
7891
7932
  break;
7892
7933
  }
7893
- if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) < 1)
7934
+ if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) === 0)
7894
7935
  report(parser, 28, KeywordDescTable[parser.token & 255]);
7895
7936
  if ((parser.token & 33619968) === 33619968)
7896
7937
  report(parser, 121);
@@ -7916,7 +7957,7 @@
7916
7957
  var left = void 0;
7917
7958
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
7918
7959
  if (parser.token & 143360) {
7919
- if ((context & 1024) < 1) {
7960
+ if ((context & 1024) === 0) {
7920
7961
  if ((parser.token & 36864) === 36864) {
7921
7962
  parser.flags |= 256;
7922
7963
  }
@@ -8237,7 +8278,7 @@
8237
8278
  id = parseIdentifier(parser, context, 0);
8238
8279
  }
8239
8280
  else {
8240
- if ((flags & 1) < 1)
8281
+ if ((flags & 1) === 0)
8241
8282
  report(parser, 37, 'Class');
8242
8283
  }
8243
8284
  var inheritedContext = context;
@@ -8368,7 +8409,7 @@
8368
8409
  }
8369
8410
  break;
8370
8411
  case 209007:
8371
- if (parser.token !== 67174411 && (parser.flags & 1) < 1) {
8412
+ if (parser.token !== 67174411 && (parser.flags & 1) === 0) {
8372
8413
  if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8373
8414
  return parsePropertyDefinition(parser, context, key, kind, decorators, tokenPos, linePos, colPos);
8374
8415
  }
@@ -8406,12 +8447,13 @@
8406
8447
  }
8407
8448
  else if (context & 1 && parser.token === 131) {
8408
8449
  kind |= 4096;
8409
- key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
8410
- context = context | 16384;
8450
+ key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
8411
8451
  }
8412
8452
  else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8413
8453
  kind |= 128;
8414
- context = context | 16384;
8454
+ }
8455
+ else if (isStatic && token === 2162700) {
8456
+ return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
8415
8457
  }
8416
8458
  else if (token === 122) {
8417
8459
  key = parseIdentifier(parser, context, 0);
@@ -8442,16 +8484,16 @@
8442
8484
  else
8443
8485
  report(parser, 131);
8444
8486
  }
8445
- if ((kind & 2) < 1) {
8487
+ if ((kind & 2) === 0) {
8446
8488
  if (parser.tokenValue === 'constructor') {
8447
8489
  if ((parser.token & 1073741824) === 1073741824) {
8448
8490
  report(parser, 125);
8449
8491
  }
8450
- else if ((kind & 32) < 1 && parser.token === 67174411) {
8492
+ else if ((kind & 32) === 0 && parser.token === 67174411) {
8451
8493
  if (kind & (768 | 16 | 128 | 8)) {
8452
8494
  report(parser, 50, 'accessor');
8453
8495
  }
8454
- else if ((context & 524288) < 1) {
8496
+ else if ((context & 524288) === 0) {
8455
8497
  if (parser.flags & 32)
8456
8498
  report(parser, 51);
8457
8499
  else
@@ -8460,7 +8502,7 @@
8460
8502
  }
8461
8503
  kind |= 64;
8462
8504
  }
8463
- else if ((kind & 4096) < 1 &&
8505
+ else if ((kind & 4096) === 0 &&
8464
8506
  kind & (32 | 768 | 8 | 16) &&
8465
8507
  parser.tokenValue === 'prototype') {
8466
8508
  report(parser, 49);
@@ -8473,7 +8515,7 @@
8473
8515
  return finishNode(parser, context, start, line, column, context & 1
8474
8516
  ? {
8475
8517
  type: 'MethodDefinition',
8476
- kind: (kind & 32) < 1 && kind & 64
8518
+ kind: (kind & 32) === 0 && kind & 64
8477
8519
  ? 'constructor'
8478
8520
  : kind & 256
8479
8521
  ? 'get'
@@ -8488,7 +8530,7 @@
8488
8530
  }
8489
8531
  : {
8490
8532
  type: 'MethodDefinition',
8491
- kind: (kind & 32) < 1 && kind & 64
8533
+ kind: (kind & 32) === 0 && kind & 64
8492
8534
  ? 'constructor'
8493
8535
  : kind & 256
8494
8536
  ? 'get'
@@ -8777,7 +8819,7 @@
8777
8819
  });
8778
8820
  }
8779
8821
  function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
8780
- nextToken(parser, context);
8822
+ nextToken(parser, context | 32768);
8781
8823
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
8782
8824
  if (parser.token === 14)
8783
8825
  return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
@@ -8831,7 +8873,7 @@
8831
8873
  __proto__: null
8832
8874
  });
8833
8875
 
8834
- var version$1 = "4.2.0";
8876
+ var version$1 = "4.3.1";
8835
8877
 
8836
8878
  var version = version$1;
8837
8879
  function parseScript(source, options) {
@@ -8852,4 +8894,4 @@
8852
8894
 
8853
8895
  Object.defineProperty(exports, '__esModule', { value: true });
8854
8896
 
8855
- })));
8897
+ }));