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.
@@ -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;
@@ -138,7 +142,6 @@
138
142
  _a[89] = 'Illegal return statement',
139
143
  _a[90] = 'The left hand side of the for-header binding declaration is not destructible',
140
144
  _a[91] = 'new.target only allowed within functions',
141
- _a[92] = "'Unexpected token: 'escaped keyword'",
142
145
  _a[93] = "'#' not followed by identifier",
143
146
  _a[99] = 'Invalid keyword',
144
147
  _a[98] = "Can not use 'let' as a class name",
@@ -153,7 +156,6 @@
153
156
  _a[104] = "Only '*' or '{...}' can be imported after default",
154
157
  _a[105] = 'Trailing decorator may be followed by method',
155
158
  _a[106] = "Decorators can't be used with a constructor",
156
- _a[107] = "'%0' may not be used as an identifier in this context",
157
159
  _a[108] = 'HTML comments are only allowed with web compatibility (Annex B)',
158
160
  _a[109] = "The identifier 'let' must not be in expression position in strict mode",
159
161
  _a[110] = 'Cannot assign to `eval` and `arguments` in strict mode',
@@ -218,7 +220,7 @@
218
220
  }
219
221
  var _this = this;
220
222
  var message = '[' + line + ':' + column + ']: ' + errorMessages[type].replace(/%(\d+)/g, function (_, i) { return params[i]; });
221
- _this = _super.call(this, "" + message) || this;
223
+ _this = _super.call(this, "".concat(message)) || this;
222
224
  _this.index = startindex;
223
225
  _this.line = line;
224
226
  _this.column = column;
@@ -236,7 +238,7 @@
236
238
  for (var _i = 2; _i < arguments.length; _i++) {
237
239
  params[_i - 2] = arguments[_i];
238
240
  }
239
- 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)))();
240
242
  }
241
243
  function reportScopeError(scope) {
242
244
  throw new ParseError(scope.index, scope.line, scope.column, scope.type, scope.params);
@@ -246,7 +248,7 @@
246
248
  for (var _i = 4; _i < arguments.length; _i++) {
247
249
  params[_i - 4] = arguments[_i];
248
250
  }
249
- 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)))();
250
252
  }
251
253
  function reportScannerError(index, line, column, type) {
252
254
  throw new ParseError(index, line, column, type);
@@ -925,7 +927,7 @@
925
927
  break;
926
928
  case 117:
927
929
  if (mask & 16)
928
- report(parser, 34, 'g');
930
+ report(parser, 34, 'u');
929
931
  mask |= 16;
930
932
  break;
931
933
  case 121:
@@ -934,9 +936,14 @@
934
936
  mask |= 8;
935
937
  break;
936
938
  case 115:
937
- if (mask & 12)
939
+ if (mask & 32)
938
940
  report(parser, 34, 's');
939
- mask |= 12;
941
+ mask |= 32;
942
+ break;
943
+ case 100:
944
+ if (mask & 64)
945
+ report(parser, 34, 'd');
946
+ mask |= 64;
940
947
  break;
941
948
  default:
942
949
  report(parser, 33);
@@ -956,7 +963,13 @@
956
963
  return new RegExp(pattern, flags);
957
964
  }
958
965
  catch (e) {
959
- report(parser, 32);
966
+ try {
967
+ new RegExp(pattern, flags.replace('d', ''));
968
+ return null;
969
+ }
970
+ catch (e) {
971
+ report(parser, 32);
972
+ }
960
973
  }
961
974
  }
962
975
 
@@ -1267,8 +1280,8 @@
1267
1280
  digits++;
1268
1281
  char = advanceChar(parser);
1269
1282
  }
1270
- if (digits < 1 || !allowSeparator) {
1271
- report(parser, digits < 1 ? 19 : 147);
1283
+ if (digits === 0 || !allowSeparator) {
1284
+ report(parser, digits === 0 ? 19 : 147);
1272
1285
  }
1273
1286
  }
1274
1287
  else if ((char | 32) === 111) {
@@ -1288,8 +1301,8 @@
1288
1301
  digits++;
1289
1302
  char = advanceChar(parser);
1290
1303
  }
1291
- if (digits < 1 || !allowSeparator) {
1292
- report(parser, digits < 1 ? 0 : 147);
1304
+ if (digits === 0 || !allowSeparator) {
1305
+ report(parser, digits === 0 ? 0 : 147);
1293
1306
  }
1294
1307
  }
1295
1308
  else if ((char | 32) === 98) {
@@ -1309,8 +1322,8 @@
1309
1322
  digits++;
1310
1323
  char = advanceChar(parser);
1311
1324
  }
1312
- if (digits < 1 || !allowSeparator) {
1313
- report(parser, digits < 1 ? 0 : 147);
1325
+ if (digits === 0 || !allowSeparator) {
1326
+ report(parser, digits === 0 ? 0 : 147);
1314
1327
  }
1315
1328
  }
1316
1329
  else if (CharTypes[char] & 32) {
@@ -1386,7 +1399,7 @@
1386
1399
  if (CharTypes[char] & 256)
1387
1400
  char = advanceChar(parser);
1388
1401
  var index = parser.index;
1389
- if ((CharTypes[char] & 16) < 1)
1402
+ if ((CharTypes[char] & 16) === 0)
1390
1403
  report(parser, 10);
1391
1404
  value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
1392
1405
  char = parser.currentChar;
@@ -1849,7 +1862,7 @@
1849
1862
  }
1850
1863
  else if (ch === 61) {
1851
1864
  advanceChar(parser);
1852
- return 8456000;
1865
+ return 8456256;
1853
1866
  }
1854
1867
  if (ch === 33) {
1855
1868
  var index = parser.index + 1;
@@ -1867,7 +1880,7 @@
1867
1880
  return 8456258;
1868
1881
  }
1869
1882
  if (ch === 47) {
1870
- if ((context & 16) < 1)
1883
+ if ((context & 16) === 0)
1871
1884
  return 8456258;
1872
1885
  var index = parser.index + 1;
1873
1886
  if (index < parser.end) {
@@ -2032,7 +2045,7 @@
2032
2045
  var ch_7 = parser.currentChar;
2033
2046
  if (ch_7 === 61) {
2034
2047
  advanceChar(parser);
2035
- return 8456001;
2048
+ return 8456257;
2036
2049
  }
2037
2050
  if (ch_7 !== 62)
2038
2051
  return 8456259;
@@ -4977,7 +4990,7 @@
4977
4990
  case 86106:
4978
4991
  report(parser, context & 1024
4979
4992
  ? 73
4980
- : (context & 256) < 1
4993
+ : (context & 256) === 0
4981
4994
  ? 75
4982
4995
  : 74);
4983
4996
  case 86096:
@@ -5023,12 +5036,12 @@
5023
5036
  });
5024
5037
  }
5025
5038
  function parseReturnStatement(parser, context, start, line, column) {
5026
- if ((context & 32) < 1 && context & 8192)
5039
+ if ((context & 32) === 0 && context & 8192)
5027
5040
  report(parser, 89);
5028
5041
  nextToken(parser, context | 32768);
5029
5042
  var argument = parser.flags & 1 || parser.token & 1048576
5030
5043
  ? null
5031
- : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.line, parser.column);
5044
+ : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
5032
5045
  matchOrInsertSemicolon(parser, context | 32768);
5033
5046
  return finishNode(parser, context, start, line, column, {
5034
5047
  type: 'ReturnStatement',
@@ -5047,7 +5060,7 @@
5047
5060
  validateAndDeclareLabel(parser, labels, value);
5048
5061
  nextToken(parser, context | 32768);
5049
5062
  var body = allowFuncDecl &&
5050
- (context & 1024) < 1 &&
5063
+ (context & 1024) === 0 &&
5051
5064
  context & 256 &&
5052
5065
  parser.token === 86106
5053
5066
  ? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
@@ -5156,7 +5169,7 @@
5156
5169
  }
5157
5170
  function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
5158
5171
  return context & 1024 ||
5159
- (context & 256) < 1 ||
5172
+ (context & 256) === 0 ||
5160
5173
  parser.token !== 86106
5161
5174
  ? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
5162
5175
  : parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
@@ -5221,11 +5234,11 @@
5221
5234
  return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
5222
5235
  }
5223
5236
  function parseContinueStatement(parser, context, labels, start, line, column) {
5224
- if ((context & 131072) < 1)
5237
+ if ((context & 131072) === 0)
5225
5238
  report(parser, 65);
5226
5239
  nextToken(parser, context);
5227
5240
  var label = null;
5228
- if ((parser.flags & 1) < 1 && parser.token & 143360) {
5241
+ if ((parser.flags & 1) === 0 && parser.token & 143360) {
5229
5242
  var tokenValue = parser.tokenValue;
5230
5243
  label = parseIdentifier(parser, context | 32768, 0);
5231
5244
  if (!isValidLabel(parser, labels, tokenValue, 1))
@@ -5240,13 +5253,13 @@
5240
5253
  function parseBreakStatement(parser, context, labels, start, line, column) {
5241
5254
  nextToken(parser, context | 32768);
5242
5255
  var label = null;
5243
- if ((parser.flags & 1) < 1 && parser.token & 143360) {
5256
+ if ((parser.flags & 1) === 0 && parser.token & 143360) {
5244
5257
  var tokenValue = parser.tokenValue;
5245
5258
  label = parseIdentifier(parser, context | 32768, 0);
5246
5259
  if (!isValidLabel(parser, labels, tokenValue, 0))
5247
5260
  report(parser, 134, tokenValue);
5248
5261
  }
5249
- else if ((context & (4096 | 131072)) < 1) {
5262
+ else if ((context & (4096 | 131072)) === 0) {
5250
5263
  report(parser, 66);
5251
5264
  }
5252
5265
  matchOrInsertSemicolon(parser, context | 32768);
@@ -5326,6 +5339,17 @@
5326
5339
  body: body
5327
5340
  });
5328
5341
  }
5342
+ function parseStaticBlock(parser, context, scope, start, line, column) {
5343
+ if (scope)
5344
+ scope = addChildScope(scope, 2);
5345
+ var ctorContext = 16384 | 524288;
5346
+ context = ((context | ctorContext) ^ ctorContext) | 262144;
5347
+ var body = parseBlock(parser, context, scope, {}, start, line, column).body;
5348
+ return finishNode(parser, context, start, line, column, {
5349
+ type: 'StaticBlock',
5350
+ body: body
5351
+ });
5352
+ }
5329
5353
  function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
5330
5354
  nextToken(parser, context | 32768);
5331
5355
  var body = parseIterationStatementBody(parser, context, scope, labels);
@@ -5413,10 +5437,10 @@
5413
5437
  if (parser.token === 1077936157) {
5414
5438
  nextToken(parser, context | 32768);
5415
5439
  init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
5416
- if (origin & 32 || (token & 2097152) < 1) {
5440
+ if (origin & 32 || (token & 2097152) === 0) {
5417
5441
  if (parser.token === 274549 ||
5418
5442
  (parser.token === 8738868 &&
5419
- (token & 2097152 || (kind & 4) < 1 || context & 1024))) {
5443
+ (token & 2097152 || (kind & 4) === 0 || context & 1024))) {
5420
5444
  reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
5421
5445
  }
5422
5446
  }
@@ -5433,7 +5457,8 @@
5433
5457
  }
5434
5458
  function parseForStatement(parser, context, scope, labels, start, line, column) {
5435
5459
  nextToken(parser, context);
5436
- var forAwait = (context & 4194304) > 0 && consumeOpt(parser, context, 209008);
5460
+ var forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
5461
+ consumeOpt(parser, context, 209008);
5437
5462
  consume(parser, context | 32768, 67174411);
5438
5463
  if (scope)
5439
5464
  scope = addChildScope(scope, 1);
@@ -5722,7 +5747,7 @@
5722
5747
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
5723
5748
  declaration = parseIdentifier(parser, context, 0);
5724
5749
  var flags = parser.flags;
5725
- if ((flags & 1) < 1) {
5750
+ if ((flags & 1) === 0) {
5726
5751
  if (parser.token === 86106) {
5727
5752
  declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
5728
5753
  }
@@ -5846,7 +5871,7 @@
5846
5871
  case 209007:
5847
5872
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
5848
5873
  nextToken(parser, context);
5849
- if ((parser.flags & 1) < 1 && parser.token === 86106) {
5874
+ if ((parser.flags & 1) === 0 && parser.token === 86106) {
5850
5875
  declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
5851
5876
  if (scope) {
5852
5877
  key = declaration.id ? declaration.id.name : '';
@@ -6003,7 +6028,7 @@
6003
6028
  var token = parser.token;
6004
6029
  var expr = parseIdentifier(parser, context, isPattern);
6005
6030
  var flags = parser.flags;
6006
- if ((flags & 1) < 1) {
6031
+ if ((flags & 1) === 0) {
6007
6032
  if (parser.token === 86106) {
6008
6033
  return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
6009
6034
  }
@@ -6037,7 +6062,7 @@
6037
6062
  report(parser, 120);
6038
6063
  var argument = null;
6039
6064
  var delegate = false;
6040
- if ((parser.flags & 1) < 1) {
6065
+ if ((parser.flags & 1) === 0) {
6041
6066
  delegate = consumeOpt(parser, context | 32768, 8457014);
6042
6067
  if (parser.token & (12288 | 65536) || delegate) {
6043
6068
  argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
@@ -6057,7 +6082,7 @@
6057
6082
  function parseAwaitExpression(parser, context, inNew, inGroup, start, line, column) {
6058
6083
  if (inGroup)
6059
6084
  parser.destructible |= 128;
6060
- if (context & 4194304) {
6085
+ if (context & 4194304 || (context & 2048 && context & 8192)) {
6061
6086
  if (inNew)
6062
6087
  report(parser, 0);
6063
6088
  if (context & 8388608) {
@@ -6065,6 +6090,8 @@
6065
6090
  }
6066
6091
  nextToken(parser, context | 32768);
6067
6092
  var argument = parseLeftHandSideExpression(parser, context, 0, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
6093
+ if (parser.token === 8457273)
6094
+ report(parser, 31);
6068
6095
  parser.assignable = 2;
6069
6096
  return finishNode(parser, context, start, line, column, {
6070
6097
  type: 'AwaitExpression',
@@ -6072,7 +6099,7 @@
6072
6099
  });
6073
6100
  }
6074
6101
  if (context & 2048)
6075
- report(parser, 107, 'Await');
6102
+ report(parser, 95);
6076
6103
  return parseIdentifierOrArrow(parser, context, start, line, column);
6077
6104
  }
6078
6105
  function parseFunctionBody(parser, context, scope, origin, firstRestricted, scopeError) {
@@ -6112,8 +6139,8 @@
6112
6139
  if (context & 64 &&
6113
6140
  scope &&
6114
6141
  scopeError !== void 0 &&
6115
- (prevContext & 1024) < 1 &&
6116
- (context & 8192) < 1) {
6142
+ (prevContext & 1024) === 0 &&
6143
+ (context & 8192) === 0) {
6117
6144
  reportScopeError(scopeError);
6118
6145
  }
6119
6146
  }
@@ -6139,19 +6166,19 @@
6139
6166
  case 67108991:
6140
6167
  report(parser, 161);
6141
6168
  case 67174411: {
6142
- if ((context & 524288) < 1)
6169
+ if ((context & 524288) === 0)
6143
6170
  report(parser, 26);
6144
6171
  if (context & 16384)
6145
- report(parser, 143);
6172
+ report(parser, 27);
6146
6173
  parser.assignable = 2;
6147
6174
  break;
6148
6175
  }
6149
6176
  case 69271571:
6150
6177
  case 67108877: {
6151
- if ((context & 262144) < 1)
6178
+ if ((context & 262144) === 0)
6152
6179
  report(parser, 27);
6153
6180
  if (context & 16384)
6154
- report(parser, 143);
6181
+ report(parser, 27);
6155
6182
  parser.assignable = 1;
6156
6183
  break;
6157
6184
  }
@@ -6178,14 +6205,14 @@
6178
6205
  });
6179
6206
  }
6180
6207
  function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain, start, line, column) {
6181
- if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) < 1) {
6208
+ if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) === 0) {
6182
6209
  expr = parseUpdateExpression(parser, context, expr, start, line, column);
6183
6210
  }
6184
6211
  else if ((parser.token & 67108864) === 67108864) {
6185
- context = (context | 134217728 | 8192) ^ (134217728 | 8192);
6212
+ context = (context | 134217728) ^ 134217728;
6186
6213
  switch (parser.token) {
6187
6214
  case 67108877: {
6188
- nextToken(parser, context | 1073741824);
6215
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6189
6216
  parser.assignable = 1;
6190
6217
  var property = parsePropertyOrPrivatePropertyName(parser, context);
6191
6218
  expr = finishNode(parser, context, start, line, column, {
@@ -6241,7 +6268,7 @@
6241
6268
  break;
6242
6269
  }
6243
6270
  case 67108991: {
6244
- nextToken(parser, context);
6271
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6245
6272
  parser.flags |= 2048;
6246
6273
  parser.assignable = 2;
6247
6274
  expr = parseOptionalChain(parser, context, expr, start, line, column);
@@ -6305,7 +6332,7 @@
6305
6332
  });
6306
6333
  }
6307
6334
  else {
6308
- if ((parser.token & (143360 | 4096)) < 1)
6335
+ if ((parser.token & (143360 | 4096)) === 0)
6309
6336
  report(parser, 154);
6310
6337
  var property = parseIdentifier(parser, context, 0);
6311
6338
  parser.assignable = 2;
@@ -6323,7 +6350,7 @@
6323
6350
  return node;
6324
6351
  }
6325
6352
  function parsePropertyOrPrivatePropertyName(parser, context) {
6326
- if ((parser.token & (143360 | 4096)) < 1 && parser.token !== 131) {
6353
+ if ((parser.token & (143360 | 4096)) === 0 && parser.token !== 131) {
6327
6354
  report(parser, 154);
6328
6355
  }
6329
6356
  return context & 1 && parser.token === 131
@@ -6648,11 +6675,11 @@
6648
6675
  var firstRestricted;
6649
6676
  var functionScope = scope ? createScope() : void 0;
6650
6677
  if (parser.token === 67174411) {
6651
- if ((flags & 1) < 1)
6678
+ if ((flags & 1) === 0)
6652
6679
  report(parser, 37, 'Function');
6653
6680
  }
6654
6681
  else {
6655
- var kind = origin & 4 && ((context & 8192) < 1 || (context & 2048) < 1)
6682
+ var kind = origin & 4 && ((context & 8192) === 0 || (context & 2048) === 0)
6656
6683
  ? 4
6657
6684
  : 64;
6658
6685
  validateFunctionName(parser, context | ((context & 3072) << 11), parser.token);
@@ -6798,7 +6825,7 @@
6798
6825
  destructible |=
6799
6826
  kind & 1
6800
6827
  ? 32
6801
- : (kind & 2) < 1
6828
+ : (kind & 2) === 0
6802
6829
  ? 16
6803
6830
  : 0;
6804
6831
  left = parseMemberOrUpdateExpression(parser, context, left, inGroup, 0, tokenPos, linePos, colPos);
@@ -6857,7 +6884,7 @@
6857
6884
  left = parseLeftHandSideExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
6858
6885
  if (parser.token !== 18 && parser.token !== 20) {
6859
6886
  left = parseAssignmentExpression(parser, context, inGroup, isPattern, tokenPos, linePos, colPos, left);
6860
- if ((kind & (2 | 1)) < 1 && token === 67174411)
6887
+ if ((kind & (2 | 1)) === 0 && token === 67174411)
6861
6888
  destructible |= 16;
6862
6889
  }
6863
6890
  else if (parser.assignable & 2) {
@@ -7046,7 +7073,7 @@
7046
7073
  });
7047
7074
  }
7048
7075
  function parseMethodDefinition(parser, context, kind, inGroup, start, line, column) {
7049
- var modifierFlags = (kind & 64) < 1 ? 31981568 : 14680064;
7076
+ var modifierFlags = (kind & 64) === 0 ? 31981568 : 14680064;
7050
7077
  context =
7051
7078
  ((context | modifierFlags) ^ modifierFlags) |
7052
7079
  ((kind & 88) << 18) |
@@ -7614,7 +7641,7 @@
7614
7641
  var left = null;
7615
7642
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
7616
7643
  if (parser.token & 143360) {
7617
- if ((context & 1024) < 1) {
7644
+ if ((context & 1024) === 0) {
7618
7645
  if ((parser.token & 36864) === 36864) {
7619
7646
  parser.flags |= 256;
7620
7647
  }
@@ -7677,7 +7704,7 @@
7677
7704
  var piStart = parser.tokenPos, plStart = parser.linePos, pcStart = parser.colPos;
7678
7705
  nextToken(parser, context | 32768 | 1073741824);
7679
7706
  var scope = context & 64 ? addChildScope(createScope(), 1024) : void 0;
7680
- context = (context | 134217728 | 8192) ^ (8192 | 134217728);
7707
+ context = (context | 134217728) ^ 134217728;
7681
7708
  if (consumeOpt(parser, context, 16)) {
7682
7709
  return parseParenthesizedArrow(parser, context, scope, [], canAssign, 0, start, line, column);
7683
7710
  }
@@ -7875,7 +7902,7 @@
7875
7902
  (134221824 | 8192 | 16384), scope, 16, void 0, void 0);
7876
7903
  switch (parser.token) {
7877
7904
  case 69271571:
7878
- if ((parser.flags & 1) < 1) {
7905
+ if ((parser.flags & 1) === 0) {
7879
7906
  report(parser, 112);
7880
7907
  }
7881
7908
  break;
@@ -7884,13 +7911,13 @@
7884
7911
  case 22:
7885
7912
  report(parser, 113);
7886
7913
  case 67174411:
7887
- if ((parser.flags & 1) < 1) {
7914
+ if ((parser.flags & 1) === 0) {
7888
7915
  report(parser, 112);
7889
7916
  }
7890
7917
  parser.flags |= 1024;
7891
7918
  break;
7892
7919
  }
7893
- if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) < 1)
7920
+ if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) === 0)
7894
7921
  report(parser, 28, KeywordDescTable[parser.token & 255]);
7895
7922
  if ((parser.token & 33619968) === 33619968)
7896
7923
  report(parser, 121);
@@ -7916,7 +7943,7 @@
7916
7943
  var left = void 0;
7917
7944
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
7918
7945
  if (parser.token & 143360) {
7919
- if ((context & 1024) < 1) {
7946
+ if ((context & 1024) === 0) {
7920
7947
  if ((parser.token & 36864) === 36864) {
7921
7948
  parser.flags |= 256;
7922
7949
  }
@@ -8237,7 +8264,7 @@
8237
8264
  id = parseIdentifier(parser, context, 0);
8238
8265
  }
8239
8266
  else {
8240
- if ((flags & 1) < 1)
8267
+ if ((flags & 1) === 0)
8241
8268
  report(parser, 37, 'Class');
8242
8269
  }
8243
8270
  var inheritedContext = context;
@@ -8368,7 +8395,7 @@
8368
8395
  }
8369
8396
  break;
8370
8397
  case 209007:
8371
- if (parser.token !== 67174411 && (parser.flags & 1) < 1) {
8398
+ if (parser.token !== 67174411 && (parser.flags & 1) === 0) {
8372
8399
  if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8373
8400
  return parsePropertyDefinition(parser, context, key, kind, decorators, tokenPos, linePos, colPos);
8374
8401
  }
@@ -8406,12 +8433,13 @@
8406
8433
  }
8407
8434
  else if (context & 1 && parser.token === 131) {
8408
8435
  kind |= 4096;
8409
- key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
8410
- context = context | 16384;
8436
+ key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
8411
8437
  }
8412
8438
  else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8413
8439
  kind |= 128;
8414
- context = context | 16384;
8440
+ }
8441
+ else if (isStatic && token === 2162700) {
8442
+ return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
8415
8443
  }
8416
8444
  else if (token === 122) {
8417
8445
  key = parseIdentifier(parser, context, 0);
@@ -8442,16 +8470,16 @@
8442
8470
  else
8443
8471
  report(parser, 131);
8444
8472
  }
8445
- if ((kind & 2) < 1) {
8473
+ if ((kind & 2) === 0) {
8446
8474
  if (parser.tokenValue === 'constructor') {
8447
8475
  if ((parser.token & 1073741824) === 1073741824) {
8448
8476
  report(parser, 125);
8449
8477
  }
8450
- else if ((kind & 32) < 1 && parser.token === 67174411) {
8478
+ else if ((kind & 32) === 0 && parser.token === 67174411) {
8451
8479
  if (kind & (768 | 16 | 128 | 8)) {
8452
8480
  report(parser, 50, 'accessor');
8453
8481
  }
8454
- else if ((context & 524288) < 1) {
8482
+ else if ((context & 524288) === 0) {
8455
8483
  if (parser.flags & 32)
8456
8484
  report(parser, 51);
8457
8485
  else
@@ -8460,7 +8488,7 @@
8460
8488
  }
8461
8489
  kind |= 64;
8462
8490
  }
8463
- else if ((kind & 4096) < 1 &&
8491
+ else if ((kind & 4096) === 0 &&
8464
8492
  kind & (32 | 768 | 8 | 16) &&
8465
8493
  parser.tokenValue === 'prototype') {
8466
8494
  report(parser, 49);
@@ -8473,7 +8501,7 @@
8473
8501
  return finishNode(parser, context, start, line, column, context & 1
8474
8502
  ? {
8475
8503
  type: 'MethodDefinition',
8476
- kind: (kind & 32) < 1 && kind & 64
8504
+ kind: (kind & 32) === 0 && kind & 64
8477
8505
  ? 'constructor'
8478
8506
  : kind & 256
8479
8507
  ? 'get'
@@ -8488,7 +8516,7 @@
8488
8516
  }
8489
8517
  : {
8490
8518
  type: 'MethodDefinition',
8491
- kind: (kind & 32) < 1 && kind & 64
8519
+ kind: (kind & 32) === 0 && kind & 64
8492
8520
  ? 'constructor'
8493
8521
  : kind & 256
8494
8522
  ? 'get'
@@ -8777,7 +8805,7 @@
8777
8805
  });
8778
8806
  }
8779
8807
  function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
8780
- nextToken(parser, context);
8808
+ nextToken(parser, context | 32768);
8781
8809
  var tokenPos = parser.tokenPos, linePos = parser.linePos, colPos = parser.colPos;
8782
8810
  if (parser.token === 14)
8783
8811
  return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
@@ -8831,7 +8859,7 @@
8831
8859
  __proto__: null
8832
8860
  });
8833
8861
 
8834
- var version$1 = "4.1.5";
8862
+ var version$1 = "4.3.0";
8835
8863
 
8836
8864
  var version = version$1;
8837
8865
  function parseScript(source, options) {
@@ -8852,4 +8880,4 @@
8852
8880
 
8853
8881
  Object.defineProperty(exports, '__esModule', { value: true });
8854
8882
 
8855
- })));
8883
+ }));