meriyah 4.2.0 → 4.2.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,16 @@
1
+ ## [4.2.1](https://github.com/meriyah/meriyah/compare/v4.2.0...v4.2.1) (2022-03-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **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)
7
+ * **parser:** allow regular expression in JSXExpressionContainer ([a5fcb80](https://github.com/meriyah/meriyah/commit/a5fcb8072084f2961e11e9db24f7b8ac0ecd04a6)), closes [#204](https://github.com/meriyah/meriyah/issues/204)
8
+ * **parser:** allow top level await in expressions ([37c6361](https://github.com/meriyah/meriyah/commit/37c63613771e5bc6e23b7da2d92e992c60dafc5a)), closes [#212](https://github.com/meriyah/meriyah/issues/212)
9
+ * **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)
10
+ * **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)
11
+
12
+
13
+
1
14
  # [4.2.0](https://github.com/meriyah/meriyah/compare/v4.1.5...v4.2.0) (2021-07-11)
2
15
 
3
16
 
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',
@@ -874,9 +874,9 @@ 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
880
  break;
881
881
  default:
882
882
  report(parser, 33);
@@ -1789,7 +1789,7 @@ define(['exports'], function (exports) { 'use strict';
1789
1789
  }
1790
1790
  else if (ch === 61) {
1791
1791
  advanceChar(parser);
1792
- return 8456000;
1792
+ return 8456256;
1793
1793
  }
1794
1794
  if (ch === 33) {
1795
1795
  const index = parser.index + 1;
@@ -1972,7 +1972,7 @@ define(['exports'], function (exports) { 'use strict';
1972
1972
  const ch = parser.currentChar;
1973
1973
  if (ch === 61) {
1974
1974
  advanceChar(parser);
1975
- return 8456001;
1975
+ return 8456257;
1976
1976
  }
1977
1977
  if (ch !== 62)
1978
1978
  return 8456259;
@@ -4964,7 +4964,7 @@ define(['exports'], function (exports) { 'use strict';
4964
4964
  nextToken(parser, context | 32768);
4965
4965
  const argument = parser.flags & 1 || parser.token & 1048576
4966
4966
  ? null
4967
- : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.line, parser.column);
4967
+ : parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
4968
4968
  matchOrInsertSemicolon(parser, context | 32768);
4969
4969
  return finishNode(parser, context, start, line, column, {
4970
4970
  type: 'ReturnStatement',
@@ -6080,7 +6080,7 @@ define(['exports'], function (exports) { 'use strict';
6080
6080
  if ((context & 524288) < 1)
6081
6081
  report(parser, 26);
6082
6082
  if (context & 16384)
6083
- report(parser, 143);
6083
+ report(parser, 27);
6084
6084
  parser.assignable = 2;
6085
6085
  break;
6086
6086
  }
@@ -6089,7 +6089,7 @@ define(['exports'], function (exports) { 'use strict';
6089
6089
  if ((context & 262144) < 1)
6090
6090
  report(parser, 27);
6091
6091
  if (context & 16384)
6092
- report(parser, 143);
6092
+ report(parser, 27);
6093
6093
  parser.assignable = 1;
6094
6094
  break;
6095
6095
  }
@@ -6120,10 +6120,10 @@ define(['exports'], function (exports) { 'use strict';
6120
6120
  expr = parseUpdateExpression(parser, context, expr, start, line, column);
6121
6121
  }
6122
6122
  else if ((parser.token & 67108864) === 67108864) {
6123
- context = (context | 134217728 | 8192) ^ (134217728 | 8192);
6123
+ context = (context | 134217728) ^ 134217728;
6124
6124
  switch (parser.token) {
6125
6125
  case 67108877: {
6126
- nextToken(parser, context | 1073741824);
6126
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6127
6127
  parser.assignable = 1;
6128
6128
  const property = parsePropertyOrPrivatePropertyName(parser, context);
6129
6129
  expr = finishNode(parser, context, start, line, column, {
@@ -6179,7 +6179,7 @@ define(['exports'], function (exports) { 'use strict';
6179
6179
  break;
6180
6180
  }
6181
6181
  case 67108991: {
6182
- nextToken(parser, context);
6182
+ nextToken(parser, (context | 1073741824 | 8192) ^ 8192);
6183
6183
  parser.flags |= 2048;
6184
6184
  parser.assignable = 2;
6185
6185
  expr = parseOptionalChain(parser, context, expr, start, line, column);
@@ -8343,12 +8343,10 @@ define(['exports'], function (exports) { 'use strict';
8343
8343
  }
8344
8344
  else if (context & 1 && parser.token === 131) {
8345
8345
  kind |= 4096;
8346
- key = parsePrivateIdentifier(parser, context, tokenPos, linePos, colPos);
8347
- context = context | 16384;
8346
+ key = parsePrivateIdentifier(parser, context | 16384, tokenPos, linePos, colPos);
8348
8347
  }
8349
8348
  else if (context & 1 && (parser.token & 1073741824) === 1073741824) {
8350
8349
  kind |= 128;
8351
- context = context | 16384;
8352
8350
  }
8353
8351
  else if (token === 122) {
8354
8352
  key = parseIdentifier(parser, context, 0);
@@ -8714,7 +8712,7 @@ define(['exports'], function (exports) { 'use strict';
8714
8712
  });
8715
8713
  }
8716
8714
  function parseJSXExpressionContainer(parser, context, inJSXChild, isAttr, start, line, column) {
8717
- nextToken(parser, context);
8715
+ nextToken(parser, context | 32768);
8718
8716
  const { tokenPos, linePos, colPos } = parser;
8719
8717
  if (parser.token === 14)
8720
8718
  return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos);
@@ -8768,7 +8766,7 @@ define(['exports'], function (exports) { 'use strict';
8768
8766
  __proto__: null
8769
8767
  });
8770
8768
 
8771
- var version$1 = "4.2.0";
8769
+ var version$1 = "4.2.1";
8772
8770
 
8773
8771
  const version = version$1;
8774
8772
  function parseScript(source, options) {
@@ -8789,4 +8787,4 @@ define(['exports'], function (exports) { 'use strict';
8789
8787
 
8790
8788
  Object.defineProperty(exports, '__esModule', { value: true });
8791
8789
 
8792
- });
8790
+ }));