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/CHANGELOG.md CHANGED
@@ -1,3 +1,43 @@
1
+ ## [4.3.1](https://github.com/meriyah/meriyah/compare/v4.3.0...v4.3.1) (2022-09-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * async is not reserved word, and some fix on reserved words ([427233e](https://github.com/meriyah/meriyah/commit/427233eef1122ac0dcdeffbc238e933eba6ada04)), closes [#221](https://github.com/meriyah/meriyah/issues/221)
7
+ * dot property should allow escaped keyword in strict mode ([efaa535](https://github.com/meriyah/meriyah/commit/efaa535b8520ecd9be73253518b575413fcabe2a)), closes [#224](https://github.com/meriyah/meriyah/issues/224)
8
+
9
+
10
+
11
+ # [4.3.0](https://github.com/meriyah/meriyah/compare/v4.2.1...v4.3.0) (2022-08-02)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **parser:** Support for class static initialization block without next flag ([a3b10f0](https://github.com/meriyah/meriyah/commit/a3b10f01651cb1f02e703fde0ef2fac1a3222d65))
17
+ * **parser:** support top level for-await in module context ([69761bf](https://github.com/meriyah/meriyah/commit/69761bf60d30524e7d95251d4219ed8166d97577)), closes [#214](https://github.com/meriyah/meriyah/issues/214)
18
+ * use null as regex value in environment missing flag "d" support ([b174ae6](https://github.com/meriyah/meriyah/commit/b174ae69cc45ce1d925c86f6c8eab8cce58057b8))
19
+
20
+
21
+ ### Features
22
+
23
+ * **lexer:** support new RegExp Indices flag "d" ([#217](https://github.com/meriyah/meriyah/issues/217)) ([b98e3bd](https://github.com/meriyah/meriyah/commit/b98e3bd79f7c13bef436976c37b04e128b40cec5)), closes [#214](https://github.com/meriyah/meriyah/issues/214)
24
+ * **parser:** Add support for class static initialization block ([1510e36](https://github.com/meriyah/meriyah/commit/1510e36b28e58317be93e59b7caed35985320c68))
25
+
26
+
27
+
28
+ ## [4.2.1](https://github.com/meriyah/meriyah/compare/v4.2.0...v4.2.1) (2022-03-31)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **lexer:** fix wrong error when using regex flag s together with m or y ([d757c6b](https://github.com/meriyah/meriyah/commit/d757c6b20ae4f6f4e55a77179726db36cf2bd50b)), closes [#202](https://github.com/meriyah/meriyah/issues/202)
34
+ * **parser:** allow regular expression in JSXExpressionContainer ([a5fcb80](https://github.com/meriyah/meriyah/commit/a5fcb8072084f2961e11e9db24f7b8ac0ecd04a6)), closes [#204](https://github.com/meriyah/meriyah/issues/204)
35
+ * **parser:** allow top level await in expressions ([37c6361](https://github.com/meriyah/meriyah/commit/37c63613771e5bc6e23b7da2d92e992c60dafc5a)), closes [#212](https://github.com/meriyah/meriyah/issues/212)
36
+ * **parser:** fix wrong starting loc for any non-trival expression in return statement ([7063af5](https://github.com/meriyah/meriyah/commit/7063af55b2c5d6d370fdf6480b87b70387c707fe)), closes [#207](https://github.com/meriyah/meriyah/issues/207)
37
+ * **parser:** super call should be allowed in private method ([6de707a](https://github.com/meriyah/meriyah/commit/6de707a0efb3053767deaa36b1ed6979b0d3f873)), closes [#203](https://github.com/meriyah/meriyah/issues/203)
38
+
39
+
40
+
1
41
  # [4.2.0](https://github.com/meriyah/meriyah/compare/v4.1.5...v4.2.0) (2021-07-11)
2
42
 
3
43
 
package/README.md CHANGED
@@ -21,8 +21,9 @@
21
21
  * Support TC39 proposals via option
22
22
  * Support for additional ECMAScript features for Web Browsers
23
23
  * JSX support via option
24
+ * Does **not** support TypeScript or Flow
24
25
  * Optionally track syntactic node locations
25
- * Emits an ESTree-compatible abstract syntax tree.
26
+ * Emits an ESTree-compatible abstract syntax tree
26
27
  * No backtracking
27
28
  * Low memory usage
28
29
  * Very well tested (~99 000 unit tests with full code coverage)
@@ -1,4 +1,4 @@
1
- define(['exports'], function (exports) { 'use strict';
1
+ define(['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  const errorMessages = {
4
4
  [0]: 'Unexpected token',
@@ -865,7 +865,7 @@ define(['exports'], function (exports) { 'use strict';
865
865
  break;
866
866
  case 117:
867
867
  if (mask & 16)
868
- report(parser, 34, 'g');
868
+ report(parser, 34, 'u');
869
869
  mask |= 16;
870
870
  break;
871
871
  case 121:
@@ -874,9 +874,14 @@ define(['exports'], function (exports) { 'use strict';
874
874
  mask |= 8;
875
875
  break;
876
876
  case 115:
877
- if (mask & 12)
877
+ if (mask & 32)
878
878
  report(parser, 34, 's');
879
- mask |= 12;
879
+ mask |= 32;
880
+ break;
881
+ case 100:
882
+ if (mask & 64)
883
+ report(parser, 34, 'd');
884
+ mask |= 64;
880
885
  break;
881
886
  default:
882
887
  report(parser, 33);
@@ -896,7 +901,13 @@ define(['exports'], function (exports) { 'use strict';
896
901
  return new RegExp(pattern, flags);
897
902
  }
898
903
  catch (e) {
899
- report(parser, 32);
904
+ try {
905
+ new RegExp(pattern, flags.replace('d', ''));
906
+ return null;
907
+ }
908
+ catch (e) {
909
+ report(parser, 32);
910
+ }
900
911
  }
901
912
  }
902
913
 
@@ -1207,8 +1218,8 @@ define(['exports'], function (exports) { 'use strict';
1207
1218
  digits++;
1208
1219
  char = advanceChar(parser);
1209
1220
  }
1210
- if (digits < 1 || !allowSeparator) {
1211
- report(parser, digits < 1 ? 19 : 147);
1221
+ if (digits === 0 || !allowSeparator) {
1222
+ report(parser, digits === 0 ? 19 : 147);
1212
1223
  }
1213
1224
  }
1214
1225
  else if ((char | 32) === 111) {
@@ -1228,8 +1239,8 @@ define(['exports'], function (exports) { 'use strict';
1228
1239
  digits++;
1229
1240
  char = advanceChar(parser);
1230
1241
  }
1231
- if (digits < 1 || !allowSeparator) {
1232
- report(parser, digits < 1 ? 0 : 147);
1242
+ if (digits === 0 || !allowSeparator) {
1243
+ report(parser, digits === 0 ? 0 : 147);
1233
1244
  }
1234
1245
  }
1235
1246
  else if ((char | 32) === 98) {
@@ -1249,8 +1260,8 @@ define(['exports'], function (exports) { 'use strict';
1249
1260
  digits++;
1250
1261
  char = advanceChar(parser);
1251
1262
  }
1252
- if (digits < 1 || !allowSeparator) {
1253
- report(parser, digits < 1 ? 0 : 147);
1263
+ if (digits === 0 || !allowSeparator) {
1264
+ report(parser, digits === 0 ? 0 : 147);
1254
1265
  }
1255
1266
  }
1256
1267
  else if (CharTypes[char] & 32) {
@@ -1326,7 +1337,7 @@ define(['exports'], function (exports) { 'use strict';
1326
1337
  if (CharTypes[char] & 256)
1327
1338
  char = advanceChar(parser);
1328
1339
  const { index } = parser;
1329
- if ((CharTypes[char] & 16) < 1)
1340
+ if ((CharTypes[char] & 16) === 0)
1330
1341
  report(parser, 10);
1331
1342
  value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);
1332
1343
  char = parser.currentChar;
@@ -1500,14 +1511,28 @@ define(['exports'], function (exports) { 'use strict';
1500
1511
  return 208897;
1501
1512
  if (!hasEscape)
1502
1513
  return token;
1514
+ if (token === 209008) {
1515
+ if ((context & (2048 | 4194304)) === 0) {
1516
+ return token;
1517
+ }
1518
+ return 121;
1519
+ }
1503
1520
  if (context & 1024) {
1504
- return token === 209008 && (context & (2048 | 4194304)) === 0
1505
- ? token
1506
- : token === 36972
1507
- ? 122
1508
- : (token & 36864) === 36864
1509
- ? 122
1510
- : 121;
1521
+ if (token === 36972) {
1522
+ return 122;
1523
+ }
1524
+ if ((token & 36864) === 36864) {
1525
+ return 122;
1526
+ }
1527
+ if ((token & 20480) === 20480) {
1528
+ if (context & 1073741824 && (context & 8192) === 0) {
1529
+ return token;
1530
+ }
1531
+ else {
1532
+ return 121;
1533
+ }
1534
+ }
1535
+ return 143483;
1511
1536
  }
1512
1537
  if (context & 1073741824 &&
1513
1538
  (context & 8192) === 0 &&
@@ -1520,13 +1545,13 @@ define(['exports'], function (exports) { 'use strict';
1520
1545
  ? 121
1521
1546
  : token;
1522
1547
  }
1523
- return token === 209007 && context & 1073741824
1524
- ? 143483
1525
- : (token & 36864) === 36864
1526
- ? token
1527
- : token === 209008 && (context & 4194304) === 0
1528
- ? token
1529
- : 121;
1548
+ if (token === 209007) {
1549
+ return 143483;
1550
+ }
1551
+ if ((token & 36864) === 36864) {
1552
+ return token;
1553
+ }
1554
+ return 121;
1530
1555
  }
1531
1556
  return 208897;
1532
1557
  }
@@ -1789,7 +1814,7 @@ define(['exports'], function (exports) { 'use strict';
1789
1814
  }
1790
1815
  else if (ch === 61) {
1791
1816
  advanceChar(parser);
1792
- return 8456000;
1817
+ return 8456256;
1793
1818
  }
1794
1819
  if (ch === 33) {
1795
1820
  const index = parser.index + 1;
@@ -1807,7 +1832,7 @@ define(['exports'], function (exports) { 'use strict';
1807
1832
  return 8456258;
1808
1833
  }
1809
1834
  if (ch === 47) {
1810
- if ((context & 16) < 1)
1835
+ if ((context & 16) === 0)
1811
1836
  return 8456258;
1812
1837
  const index = parser.index + 1;
1813
1838
  if (index < parser.end) {
@@ -1972,7 +1997,7 @@ define(['exports'], function (exports) { 'use strict';
1972
1997
  const ch = parser.currentChar;
1973
1998
  if (ch === 61) {
1974
1999
  advanceChar(parser);
1975
- return 8456001;
2000
+ return 8456257;
1976
2001
  }
1977
2002
  if (ch !== 62)
1978
2003
  return 8456259;
@@ -4913,7 +4938,7 @@ define(['exports'], function (exports) { 'use strict';
4913
4938
  case 86106:
4914
4939
  report(parser, context & 1024
4915
4940
  ? 73
4916
- : (context & 256) < 1
4941
+ : (context & 256) === 0
4917
4942
  ? 75
4918
4943
  : 74);
4919
4944
  case 86096:
@@ -4959,12 +4984,12 @@ define(['exports'], function (exports) { 'use strict';
4959
4984
  });
4960
4985
  }
4961
4986
  function parseReturnStatement(parser, context, start, line, column) {
4962
- if ((context & 32) < 1 && context & 8192)
4987
+ if ((context & 32) === 0 && context & 8192)
4963
4988
  report(parser, 89);
4964
4989
  nextToken(parser, context | 32768);
4965
4990
  const argument = parser.flags & 1 || parser.token & 1048576
4966
4991
  ? null
4967
- : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.line, parser.column);
4992
+ : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
4968
4993
  matchOrInsertSemicolon(parser, context | 32768);
4969
4994
  return finishNode(parser, context, start, line, column, {
4970
4995
  type: 'ReturnStatement',
@@ -4983,7 +5008,7 @@ define(['exports'], function (exports) { 'use strict';
4983
5008
  validateAndDeclareLabel(parser, labels, value);
4984
5009
  nextToken(parser, context | 32768);
4985
5010
  const body = allowFuncDecl &&
4986
- (context & 1024) < 1 &&
5011
+ (context & 1024) === 0 &&
4987
5012
  context & 256 &&
4988
5013
  parser.token === 86106
4989
5014
  ? parseFunctionDeclaration(parser, context, addChildScope(scope, 2), origin, 0, 0, 0, parser.tokenPos, parser.linePos, parser.colPos)
@@ -5092,7 +5117,7 @@ define(['exports'], function (exports) { 'use strict';
5092
5117
  }
5093
5118
  function parseConsequentOrAlternative(parser, context, scope, labels, start, line, column) {
5094
5119
  return context & 1024 ||
5095
- (context & 256) < 1 ||
5120
+ (context & 256) === 0 ||
5096
5121
  parser.token !== 86106
5097
5122
  ? parseStatement(parser, context, scope, 0, { $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos)
5098
5123
  : parseFunctionDeclaration(parser, context, addChildScope(scope, 2), 0, 0, 0, 0, start, line, column);
@@ -5157,11 +5182,11 @@ define(['exports'], function (exports) { 'use strict';
5157
5182
  return parseStatement(parser, ((context | 134217728) ^ 134217728) | 131072, scope, 0, { loop: 1, $: labels }, 0, parser.tokenPos, parser.linePos, parser.colPos);
5158
5183
  }
5159
5184
  function parseContinueStatement(parser, context, labels, start, line, column) {
5160
- if ((context & 131072) < 1)
5185
+ if ((context & 131072) === 0)
5161
5186
  report(parser, 65);
5162
5187
  nextToken(parser, context);
5163
5188
  let label = null;
5164
- if ((parser.flags & 1) < 1 && parser.token & 143360) {
5189
+ if ((parser.flags & 1) === 0 && parser.token & 143360) {
5165
5190
  const { tokenValue } = parser;
5166
5191
  label = parseIdentifier(parser, context | 32768, 0);
5167
5192
  if (!isValidLabel(parser, labels, tokenValue, 1))
@@ -5176,13 +5201,13 @@ define(['exports'], function (exports) { 'use strict';
5176
5201
  function parseBreakStatement(parser, context, labels, start, line, column) {
5177
5202
  nextToken(parser, context | 32768);
5178
5203
  let label = null;
5179
- if ((parser.flags & 1) < 1 && parser.token & 143360) {
5204
+ if ((parser.flags & 1) === 0 && parser.token & 143360) {
5180
5205
  const { tokenValue } = parser;
5181
5206
  label = parseIdentifier(parser, context | 32768, 0);
5182
5207
  if (!isValidLabel(parser, labels, tokenValue, 0))
5183
5208
  report(parser, 134, tokenValue);
5184
5209
  }
5185
- else if ((context & (4096 | 131072)) < 1) {
5210
+ else if ((context & (4096 | 131072)) === 0) {
5186
5211
  report(parser, 66);
5187
5212
  }
5188
5213
  matchOrInsertSemicolon(parser, context | 32768);
@@ -5262,6 +5287,17 @@ define(['exports'], function (exports) { 'use strict';
5262
5287
  body
5263
5288
  });
5264
5289
  }
5290
+ function parseStaticBlock(parser, context, scope, start, line, column) {
5291
+ if (scope)
5292
+ scope = addChildScope(scope, 2);
5293
+ const ctorContext = 16384 | 524288;
5294
+ context = ((context | ctorContext) ^ ctorContext) | 262144;
5295
+ const { body } = parseBlock(parser, context, scope, {}, start, line, column);
5296
+ return finishNode(parser, context, start, line, column, {
5297
+ type: 'StaticBlock',
5298
+ body
5299
+ });
5300
+ }
5265
5301
  function parseDoWhileStatement(parser, context, scope, labels, start, line, column) {
5266
5302
  nextToken(parser, context | 32768);
5267
5303
  const body = parseIterationStatementBody(parser, context, scope, labels);
@@ -5349,10 +5385,10 @@ define(['exports'], function (exports) { 'use strict';
5349
5385
  if (parser.token === 1077936157) {
5350
5386
  nextToken(parser, context | 32768);
5351
5387
  init = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
5352
- if (origin & 32 || (token & 2097152) < 1) {
5388
+ if (origin & 32 || (token & 2097152) === 0) {
5353
5389
  if (parser.token === 274549 ||
5354
5390
  (parser.token === 8738868 &&
5355
- (token & 2097152 || (kind & 4) < 1 || context & 1024))) {
5391
+ (token & 2097152 || (kind & 4) === 0 || context & 1024))) {
5356
5392
  reportMessageAt(tokenPos, parser.line, parser.index - 3, 57, parser.token === 274549 ? 'of' : 'in');
5357
5393
  }
5358
5394
  }
@@ -5369,7 +5405,8 @@ define(['exports'], function (exports) { 'use strict';
5369
5405
  }
5370
5406
  function parseForStatement(parser, context, scope, labels, start, line, column) {
5371
5407
  nextToken(parser, context);
5372
- const forAwait = (context & 4194304) > 0 && consumeOpt(parser, context, 209008);
5408
+ const forAwait = ((context & 4194304) > 0 || ((context & 2048) > 0 && (context & 8192) > 0)) &&
5409
+ consumeOpt(parser, context, 209008);
5373
5410
  consume(parser, context | 32768, 67174411);
5374
5411
  if (scope)
5375
5412
  scope = addChildScope(scope, 1);
@@ -5658,7 +5695,7 @@ define(['exports'], function (exports) { 'use strict';
5658
5695
  const { tokenPos, linePos, colPos } = parser;
5659
5696
  declaration = parseIdentifier(parser, context, 0);
5660
5697
  const { flags } = parser;
5661
- if ((flags & 1) < 1) {
5698
+ if ((flags & 1) === 0) {
5662
5699
  if (parser.token === 86106) {
5663
5700
  declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 1, 1, tokenPos, linePos, colPos);
5664
5701
  }
@@ -5782,7 +5819,7 @@ define(['exports'], function (exports) { 'use strict';
5782
5819
  case 209007:
5783
5820
  const { tokenPos, linePos, colPos } = parser;
5784
5821
  nextToken(parser, context);
5785
- if ((parser.flags & 1) < 1 && parser.token === 86106) {
5822
+ if ((parser.flags & 1) === 0 && parser.token === 86106) {
5786
5823
  declaration = parseFunctionDeclaration(parser, context, scope, 4, 1, 2, 1, tokenPos, linePos, colPos);
5787
5824
  if (scope) {
5788
5825
  key = declaration.id ? declaration.id.name : '';
@@ -5939,7 +5976,7 @@ define(['exports'], function (exports) { 'use strict';
5939
5976
  const { token } = parser;
5940
5977
  const expr = parseIdentifier(parser, context, isPattern);
5941
5978
  const { flags } = parser;
5942
- if ((flags & 1) < 1) {
5979
+ if ((flags & 1) === 0) {
5943
5980
  if (parser.token === 86106) {
5944
5981
  return parseFunctionExpression(parser, context, 1, inGroup, start, line, column);
5945
5982
  }
@@ -5973,7 +6010,7 @@ define(['exports'], function (exports) { 'use strict';
5973
6010
  report(parser, 120);
5974
6011
  let argument = null;
5975
6012
  let delegate = false;
5976
- if ((parser.flags & 1) < 1) {
6013
+ if ((parser.flags & 1) === 0) {
5977
6014
  delegate = consumeOpt(parser, context | 32768, 8457014);
5978
6015
  if (parser.token & (12288 | 65536) || delegate) {
5979
6016
  argument = parseExpression(parser, context, 1, 0, 0, parser.tokenPos, parser.linePos, parser.colPos);
@@ -6050,8 +6087,8 @@ define(['exports'], function (exports) { 'use strict';
6050
6087
  if (context & 64 &&
6051
6088
  scope &&
6052
6089
  scopeError !== void 0 &&
6053
- (prevContext & 1024) < 1 &&
6054
- (context & 8192) < 1) {
6090
+ (prevContext & 1024) === 0 &&
6091
+ (context & 8192) === 0) {
6055
6092
  reportScopeError(scopeError);
6056
6093
  }
6057
6094
  }
@@ -6077,19 +6114,19 @@ define(['exports'], function (exports) { 'use strict';
6077
6114
  case 67108991:
6078
6115
  report(parser, 161);
6079
6116
  case 67174411: {
6080
- if ((context & 524288) < 1)
6117
+ if ((context & 524288) === 0)
6081
6118
  report(parser, 26);
6082
6119
  if (context & 16384)
6083
- report(parser, 143);
6120
+ report(parser, 27);
6084
6121
  parser.assignable = 2;
6085
6122
  break;
6086
6123
  }
6087
6124
  case 69271571:
6088
6125
  case 67108877: {
6089
- if ((context & 262144) < 1)
6126
+ if ((context & 262144) === 0)
6090
6127
  report(parser, 27);
6091
6128
  if (context & 16384)
6092
- report(parser, 143);
6129
+ report(parser, 27);
6093
6130
  parser.assignable = 1;
6094
6131
  break;
6095
6132
  }
@@ -6116,14 +6153,14 @@ define(['exports'], function (exports) { 'use strict';
6116
6153
  });
6117
6154
  }
6118
6155
  function parseMemberOrUpdateExpression(parser, context, expr, inGroup, inChain, start, line, column) {
6119
- if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) < 1) {
6156
+ if ((parser.token & 33619968) === 33619968 && (parser.flags & 1) === 0) {
6120
6157
  expr = parseUpdateExpression(parser, context, expr, start, line, column);
6121
6158
  }
6122
6159
  else if ((parser.token & 67108864) === 67108864) {
6123
- context = (context | 134217728 | 8192) ^ (134217728 | 8192);
6160
+ context = (context | 134217728) ^ 134217728;
6124
6161
  switch (parser.token) {
6125
6162
  case 67108877: {
6126
- nextToken(parser, context | 1073741824);
6163
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6127
6164
  parser.assignable = 1;
6128
6165
  const property = parsePropertyOrPrivatePropertyName(parser, context);
6129
6166
  expr = finishNode(parser, context, start, line, column, {
@@ -6179,7 +6216,7 @@ define(['exports'], function (exports) { 'use strict';
6179
6216
  break;
6180
6217
  }
6181
6218
  case 67108991: {
6182
- nextToken(parser, context);
6219
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6183
6220
  parser.flags |= 2048;
6184
6221
  parser.assignable = 2;
6185
6222
  expr = parseOptionalChain(parser, context, expr, start, line, column);
@@ -6243,7 +6280,7 @@ define(['exports'], function (exports) { 'use strict';
6243
6280
  });
6244
6281
  }
6245
6282
  else {
6246
- if ((parser.token & (143360 | 4096)) < 1)
6283
+ if ((parser.token & (143360 | 4096)) === 0)
6247
6284
  report(parser, 154);
6248
6285
  const property = parseIdentifier(parser, context, 0);
6249
6286
  parser.assignable = 2;
@@ -6261,7 +6298,7 @@ define(['exports'], function (exports) { 'use strict';
6261
6298
  return node;
6262
6299
  }
6263
6300
  function parsePropertyOrPrivatePropertyName(parser, context) {
6264
- if ((parser.token & (143360 | 4096)) < 1 && parser.token !== 131) {
6301
+ if ((parser.token & (143360 | 4096)) === 0 && parser.token !== 131) {
6265
6302
  report(parser, 154);
6266
6303
  }
6267
6304
  return context & 1 && parser.token === 131
@@ -6586,11 +6623,11 @@ define(['exports'], function (exports) { 'use strict';
6586
6623
  let firstRestricted;
6587
6624
  let functionScope = scope ? createScope() : void 0;
6588
6625
  if (parser.token === 67174411) {
6589
- if ((flags & 1) < 1)
6626
+ if ((flags & 1) === 0)
6590
6627
  report(parser, 37, 'Function');
6591
6628
  }
6592
6629
  else {
6593
- const kind = origin & 4 && ((context & 8192) < 1 || (context & 2048) < 1)
6630
+ const kind = origin & 4 && ((context & 8192) === 0 || (context & 2048) === 0)
6594
6631
  ? 4
6595
6632
  : 64;
6596
6633
  validateFunctionName(parser, context | ((context & 3072) << 11), parser.token);
@@ -6736,7 +6773,7 @@ define(['exports'], function (exports) { 'use strict';
6736
6773
  destructible |=
6737
6774
  kind & 1
6738
6775
  ? 32
6739
- : (kind & 2) < 1
6776
+ : (kind & 2) === 0
6740
6777
  ? 16
6741
6778
  : 0;
6742
6779
  left = parseMemberOrUpdateExpression(parser, context, left, inGroup, 0, tokenPos, linePos, colPos);
@@ -6795,7 +6832,7 @@ define(['exports'], function (exports) { 'use strict';
6795
6832
  left = parseLeftHandSideExpression(parser, context, 1, 0, 1, tokenPos, linePos, colPos);
6796
6833
  if (parser.token !== 18 && parser.token !== 20) {
6797
6834
  left = parseAssignmentExpression(parser, context, inGroup, isPattern, tokenPos, linePos, colPos, left);
6798
- if ((kind & (2 | 1)) < 1 && token === 67174411)
6835
+ if ((kind & (2 | 1)) === 0 && token === 67174411)
6799
6836
  destructible |= 16;
6800
6837
  }
6801
6838
  else if (parser.assignable & 2) {
@@ -6984,7 +7021,7 @@ define(['exports'], function (exports) { 'use strict';
6984
7021
  });
6985
7022
  }
6986
7023
  function parseMethodDefinition(parser, context, kind, inGroup, start, line, column) {
6987
- const modifierFlags = (kind & 64) < 1 ? 31981568 : 14680064;
7024
+ const modifierFlags = (kind & 64) === 0 ? 31981568 : 14680064;
6988
7025
  context =
6989
7026
  ((context | modifierFlags) ^ modifierFlags) |
6990
7027
  ((kind & 88) << 18) |
@@ -7552,7 +7589,7 @@ define(['exports'], function (exports) { 'use strict';
7552
7589
  let left = null;
7553
7590
  const { tokenPos, linePos, colPos } = parser;
7554
7591
  if (parser.token & 143360) {
7555
- if ((context & 1024) < 1) {
7592
+ if ((context & 1024) === 0) {
7556
7593
  if ((parser.token & 36864) === 36864) {
7557
7594
  parser.flags |= 256;
7558
7595
  }
@@ -7813,7 +7850,7 @@ define(['exports'], function (exports) { 'use strict';
7813
7850
  (134221824 | 8192 | 16384), scope, 16, void 0, void 0);
7814
7851
  switch (parser.token) {
7815
7852
  case 69271571:
7816
- if ((parser.flags & 1) < 1) {
7853
+ if ((parser.flags & 1) === 0) {
7817
7854
  report(parser, 112);
7818
7855
  }
7819
7856
  break;
@@ -7822,13 +7859,13 @@ define(['exports'], function (exports) { 'use strict';
7822
7859
  case 22:
7823
7860
  report(parser, 113);
7824
7861
  case 67174411:
7825
- if ((parser.flags & 1) < 1) {
7862
+ if ((parser.flags & 1) === 0) {
7826
7863
  report(parser, 112);
7827
7864
  }
7828
7865
  parser.flags |= 1024;
7829
7866
  break;
7830
7867
  }
7831
- if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) < 1)
7868
+ if ((parser.token & 8454144) === 8454144 && (parser.flags & 1) === 0)
7832
7869
  report(parser, 28, KeywordDescTable[parser.token & 255]);
7833
7870
  if ((parser.token & 33619968) === 33619968)
7834
7871
  report(parser, 121);
@@ -7854,7 +7891,7 @@ define(['exports'], function (exports) { 'use strict';
7854
7891
  let left;
7855
7892
  const { tokenPos, linePos, colPos } = parser;
7856
7893
  if (parser.token & 143360) {
7857
- if ((context & 1024) < 1) {
7894
+ if ((context & 1024) === 0) {
7858
7895
  if ((parser.token & 36864) === 36864) {
7859
7896
  parser.flags |= 256;
7860
7897
  }
@@ -8174,7 +8211,7 @@ define(['exports'], function (exports) { 'use strict';
8174
8211
  id = parseIdentifier(parser, context, 0);
8175
8212
  }
8176
8213
  else {
8177
- if ((flags & 1) < 1)
8214
+ if ((flags & 1) === 0)
8178
8215
  report(parser, 37, 'Class');
8179
8216
  }
8180
8217
  let inheritedContext = context;
@@ -8305,7 +8342,7 @@ define(['exports'], function (exports) { 'use strict';
8305
8342
  }
8306
8343
  break;
8307
8344
  case 209007:
8308
- if (parser.token !== 67174411 && (parser.flags & 1) < 1) {
8345
+ if (parser.token !== 67174411 && (parser.flags & 1) === 0) {
8309
8346
  if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8310
8347
  return parsePropertyDefinition(parser, context, key, kind, decorators, tokenPos, linePos, colPos);
8311
8348
  }
@@ -8343,12 +8380,13 @@ define(['exports'], function (exports) { 'use strict';
8343
8380
  }
8344
8381
  else if (context & 1 && parser.token === 131) {
8345
8382
  kind |= 4096;
8346
- key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
8347
- context = context | 16384;
8383
+ key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
8348
8384
  }
8349
8385
  else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8350
8386
  kind |= 128;
8351
- context = context | 16384;
8387
+ }
8388
+ else if (isStatic && token === 2162700) {
8389
+ return parseStaticBlock(parser, context, scope, tokenPos, linePos, colPos);
8352
8390
  }
8353
8391
  else if (token === 122) {
8354
8392
  key = parseIdentifier(parser, context, 0);
@@ -8379,16 +8417,16 @@ define(['exports'], function (exports) { 'use strict';
8379
8417
  else
8380
8418
  report(parser, 131);
8381
8419
  }
8382
- if ((kind & 2) < 1) {
8420
+ if ((kind & 2) === 0) {
8383
8421
  if (parser.tokenValue === 'constructor') {
8384
8422
  if ((parser.token & 1073741824) === 1073741824) {
8385
8423
  report(parser, 125);
8386
8424
  }
8387
- else if ((kind & 32) < 1 && parser.token === 67174411) {
8425
+ else if ((kind & 32) === 0 && parser.token === 67174411) {
8388
8426
  if (kind & (768 | 16 | 128 | 8)) {
8389
8427
  report(parser, 50, 'accessor');
8390
8428
  }
8391
- else if ((context & 524288) < 1) {
8429
+ else if ((context & 524288) === 0) {
8392
8430
  if (parser.flags & 32)
8393
8431
  report(parser, 51);
8394
8432
  else
@@ -8397,7 +8435,7 @@ define(['exports'], function (exports) { 'use strict';
8397
8435
  }
8398
8436
  kind |= 64;
8399
8437
  }
8400
- else if ((kind & 4096) < 1 &&
8438
+ else if ((kind & 4096) === 0 &&
8401
8439
  kind & (32 | 768 | 8 | 16) &&
8402
8440
  parser.tokenValue === 'prototype') {
8403
8441
  report(parser, 49);
@@ -8410,7 +8448,7 @@ define(['exports'], function (exports) { 'use strict';
8410
8448
  return finishNode(parser, context, start, line, column, context & 1
8411
8449
  ? {
8412
8450
  type: 'MethodDefinition',
8413
- kind: (kind & 32) < 1 && kind & 64
8451
+ kind: (kind & 32) === 0 && kind & 64
8414
8452
  ? 'constructor'
8415
8453
  : kind & 256
8416
8454
  ? 'get'
@@ -8425,7 +8463,7 @@ define(['exports'], function (exports) { 'use strict';
8425
8463
  }
8426
8464
  : {
8427
8465
  type: 'MethodDefinition',
8428
- kind: (kind & 32) < 1 && kind & 64
8466
+ kind: (kind & 32) === 0 && kind & 64
8429
8467
  ? 'constructor'
8430
8468
  : kind & 256
8431
8469
  ? 'get'
@@ -8714,7 +8752,7 @@ define(['exports'], function (exports) { 'use strict';
8714
8752
  });
8715
8753
  }
8716
8754
  function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
8717
- nextToken(parser, context);
8755
+ nextToken(parser, context | 32768);
8718
8756
  const { tokenPos, linePos, colPos } = parser;
8719
8757
  if (parser.token === 14)
8720
8758
  return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
@@ -8768,7 +8806,7 @@ define(['exports'], function (exports) { 'use strict';
8768
8806
  __proto__: null
8769
8807
  });
8770
8808
 
8771
- var version$1 = "4.2.0";
8809
+ var version$1 = "4.3.1";
8772
8810
 
8773
8811
  const version = version$1;
8774
8812
  function parseScript(source, options) {
@@ -8789,4 +8827,4 @@ define(['exports'], function (exports) { 'use strict';
8789
8827
 
8790
8828
  Object.defineProperty(exports, '__esModule', { value: true });
8791
8829
 
8792
- });
8830
+ }));