meriyah 4.1.5 → 4.2.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [4.2.0](https://github.com/meriyah/meriyah/compare/v4.1.5...v4.2.0) (2021-07-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **parser:** keep InGlobal flag in parenthesized ([023ee0e](https://github.com/meriyah/meriyah/commit/023ee0e36fc28e75d0448739b8343ec801ac887f))
7
+ * **parser:** rejects "await 2**2" ([9a75bf6](https://github.com/meriyah/meriyah/commit/9a75bf67c9a6d22d28accc782665ed614a5a66c1)), closes [#187](https://github.com/meriyah/meriyah/issues/187)
8
+
9
+
10
+ ### Features
11
+
12
+ * **parser:** support top-level await ([7b2a5bd](https://github.com/meriyah/meriyah/commit/7b2a5bd5832cfa4c98dac4219f22901c6eb28196)), closes [#186](https://github.com/meriyah/meriyah/issues/186)
13
+
14
+
15
+
1
16
  ## [4.1.5](https://github.com/meriyah/meriyah/compare/v4.1.4...v4.1.5) (2021-03-05)
2
17
 
3
18
 
@@ -96,7 +96,6 @@ define(['exports'], function (exports) { 'use strict';
96
96
  [89]: 'Illegal return statement',
97
97
  [90]: 'The left hand side of the for-header binding declaration is not destructible',
98
98
  [91]: 'new.target only allowed within functions',
99
- [92]: "'Unexpected token: 'escaped keyword'",
100
99
  [93]: "'#' not followed by identifier",
101
100
  [99]: 'Invalid keyword',
102
101
  [98]: "Can not use 'let' as a class name",
@@ -111,7 +110,6 @@ define(['exports'], function (exports) { 'use strict';
111
110
  [104]: "Only '*' or '{...}' can be imported after default",
112
111
  [105]: 'Trailing decorator may be followed by method',
113
112
  [106]: "Decorators can't be used with a constructor",
114
- [107]: "'%0' may not be used as an identifier in this context",
115
113
  [108]: 'HTML comments are only allowed with web compatibility (Annex B)',
116
114
  [109]: "The identifier 'let' must not be in expression position in strict mode",
117
115
  [110]: 'Cannot assign to `eval` and `arguments` in strict mode',
@@ -5995,7 +5993,7 @@ define(['exports'], function (exports) { 'use strict';
5995
5993
  function parseAwaitExpression(parser, context, inNew, inGroup, start, line, column) {
5996
5994
  if (inGroup)
5997
5995
  parser.destructible |= 128;
5998
- if (context & 4194304) {
5996
+ if (context & 4194304 || (context & 2048 && context & 8192)) {
5999
5997
  if (inNew)
6000
5998
  report(parser, 0);
6001
5999
  if (context & 8388608) {
@@ -6003,6 +6001,8 @@ define(['exports'], function (exports) { 'use strict';
6003
6001
  }
6004
6002
  nextToken(parser, context | 32768);
6005
6003
  const argument = parseLeftHandSideExpression(parser, context, 0, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
6004
+ if (parser.token === 8457273)
6005
+ report(parser, 31);
6006
6006
  parser.assignable = 2;
6007
6007
  return finishNode(parser, context, start, line, column, {
6008
6008
  type: 'AwaitExpression',
@@ -6010,7 +6010,7 @@ define(['exports'], function (exports) { 'use strict';
6010
6010
  });
6011
6011
  }
6012
6012
  if (context & 2048)
6013
- report(parser, 107, 'Await');
6013
+ report(parser, 95);
6014
6014
  return parseIdentifierOrArrow(parser, context, start, line, column);
6015
6015
  }
6016
6016
  function parseFunctionBody(parser, context, scope, origin, firstRestricted, scopeError) {
@@ -7615,7 +7615,7 @@ define(['exports'], function (exports) { 'use strict';
7615
7615
  const { tokenPos: piStart, linePos: plStart, colPos: pcStart } = parser;
7616
7616
  nextToken(parser, context | 32768 | 1073741824);
7617
7617
  const scope = context & 64 ? addChildScope(createScope(), 1024) : void 0;
7618
- context = (context | 134217728 | 8192) ^ (8192 | 134217728);
7618
+ context = (context | 134217728) ^ 134217728;
7619
7619
  if (consumeOpt(parser, context, 16)) {
7620
7620
  return parseParenthesizedArrow(parser, context, scope, [], canAssign, 0, start, line, column);
7621
7621
  }
@@ -8768,7 +8768,7 @@ define(['exports'], function (exports) { 'use strict';
8768
8768
  __proto__: null
8769
8769
  });
8770
8770
 
8771
- var version$1 = "4.1.5";
8771
+ var version$1 = "4.2.0";
8772
8772
 
8773
8773
  const version = version$1;
8774
8774
  function parseScript(source, options) {