meriyah 7.1.1 → 7.1.2
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 +9 -0
- package/README.md +6 -3
- package/dist/meriyah.cjs +28 -22
- package/dist/meriyah.min.mjs +1 -1
- package/dist/meriyah.mjs +28 -22
- package/dist/meriyah.umd.js +28 -22
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/types/common.d.ts +2 -2
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/lexer/comments.d.ts +3 -3
- package/dist/types/lexer/common.d.ts +2 -2
- package/dist/types/lexer/identifier.d.ts +3 -3
- package/dist/types/lexer/index.d.ts +3 -3
- package/dist/types/lexer/jsx.d.ts +3 -3
- package/dist/types/lexer/numeric.d.ts +4 -4
- package/dist/types/lexer/regexp.d.ts +2 -2
- package/dist/types/lexer/scan.d.ts +4 -4
- package/dist/types/lexer/string.d.ts +3 -3
- package/dist/types/lexer/template.d.ts +3 -3
- package/dist/types/meriyah.d.ts +6 -6
- package/dist/types/options.d.ts +3 -3
- package/dist/types/parser/parser.d.ts +7 -7
- package/dist/types/parser/private-scope.d.ts +2 -2
- package/dist/types/parser/scope.d.ts +3 -3
- package/dist/types/parser.d.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [7.1.2](https://github.com/meriyah/meriyah/compare/v7.1.1...v7.1.2) (2026-07-11)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **lexer:** reject empty unicode code point escape \u{} ([#562](https://github.com/meriyah/meriyah/issues/562)) ([6dd2bba](https://github.com/meriyah/meriyah/commit/6dd2bba7bf9375f751ee9214526e4592702dab9d))
|
|
6
|
+
* **parser:** mark template literal with substitutions as invalid assignment target ([#563](https://github.com/meriyah/meriyah/issues/563)) ([addcad6](https://github.com/meriyah/meriyah/commit/addcad684d5f1e13bcaebe8e97db7ca39370f603))
|
|
7
|
+
* **parser:** parse get and set fields before generators ([#576](https://github.com/meriyah/meriyah/issues/576)) ([cad0605](https://github.com/meriyah/meriyah/commit/cad06053fc9ee16a2217f84ca46d45d9b25c17e7))
|
|
8
|
+
* **parser:** treat let as identifier before in and instanceof ([#577](https://github.com/meriyah/meriyah/issues/577)) ([4a08591](https://github.com/meriyah/meriyah/commit/4a085918dce320f39b535a15eafb774a0b4b90b0))
|
|
9
|
+
|
|
1
10
|
## [7.1.1](https://github.com/meriyah/meriyah/compare/v7.1.0...v7.1.1) (2026-07-05)
|
|
2
11
|
|
|
3
12
|
|
package/README.md
CHANGED
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
- No backtracking
|
|
27
27
|
- Low memory usage
|
|
28
28
|
|
|
29
|
+
### Not yet supported features:
|
|
30
|
+
|
|
31
|
+
- [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management)
|
|
32
|
+
|
|
29
33
|
## ESNext Stage 3 features
|
|
30
34
|
|
|
31
35
|
### Supported stage 3 features:
|
|
@@ -33,12 +37,11 @@
|
|
|
33
37
|
These features need to be enabled with the `next` option.
|
|
34
38
|
|
|
35
39
|
- [Decorators](https://github.com/tc39/proposal-decorators)
|
|
36
|
-
- [JSON Modules](https://github.com/tc39/proposal-json-modules)
|
|
37
40
|
|
|
38
41
|
### Not yet supported stage 3 features:
|
|
39
42
|
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
43
|
+
- [Source Phase Imports](https://github.com/tc39/proposal-source-phase-imports)
|
|
44
|
+
- [Deferring Module Evaluation](https://github.com/tc39/proposal-defer-import-eval)
|
|
42
45
|
|
|
43
46
|
## RegExp support
|
|
44
47
|
|
package/dist/meriyah.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var version$1 = "7.1.
|
|
3
|
+
var version$1 = "7.1.2";
|
|
4
|
+
var packageJson = {
|
|
5
|
+
version: version$1};
|
|
4
6
|
|
|
5
7
|
const unicodeLookup = ((compressed, lookup) => {
|
|
6
8
|
const result = new Uint32Array(69632);
|
|
@@ -1520,12 +1522,14 @@ function parseEscape(parser, context, first, isTemplate = 0) {
|
|
|
1520
1522
|
const ch = advanceChar(parser);
|
|
1521
1523
|
if (parser.currentChar === 123) {
|
|
1522
1524
|
let code = 0;
|
|
1525
|
+
let digits = 0;
|
|
1523
1526
|
while ((CharTypes[advanceChar(parser)] & 64) !== 0) {
|
|
1524
1527
|
code = (code << 4) | toHex(parser.currentChar);
|
|
1525
1528
|
if (code > 1114111)
|
|
1526
1529
|
return -5;
|
|
1530
|
+
digits++;
|
|
1527
1531
|
}
|
|
1528
|
-
if (parser.currentChar < 1 || parser.currentChar !== 125) {
|
|
1532
|
+
if (digits === 0 || parser.currentChar < 1 || parser.currentChar !== 125) {
|
|
1529
1533
|
return -4;
|
|
1530
1534
|
}
|
|
1531
1535
|
return code;
|
|
@@ -4932,7 +4936,7 @@ function parseSource(source, rawOptions = {}, context = 0) {
|
|
|
4932
4936
|
context |= 1;
|
|
4933
4937
|
skipHashBang(parser);
|
|
4934
4938
|
const scope = parser.createScopeIfLexical();
|
|
4935
|
-
let body
|
|
4939
|
+
let body;
|
|
4936
4940
|
let sourceType = 'script';
|
|
4937
4941
|
if (context & 2) {
|
|
4938
4942
|
sourceType = 'module';
|
|
@@ -5425,7 +5429,6 @@ function parseTryStatement(parser, context, scope, privateScope, labels) {
|
|
|
5425
5429
|
}
|
|
5426
5430
|
function parseCatchBlock(parser, context, scope, privateScope, labels, start) {
|
|
5427
5431
|
let param = null;
|
|
5428
|
-
let additionalScope = scope;
|
|
5429
5432
|
if (consumeOpt(parser, context, 67174411)) {
|
|
5430
5433
|
scope = scope?.createChildScope(4);
|
|
5431
5434
|
param = parseBindingPattern(parser, context, scope, privateScope, (parser.getToken() & 2097152) === 2097152
|
|
@@ -5439,7 +5442,7 @@ function parseCatchBlock(parser, context, scope, privateScope, labels, start) {
|
|
|
5439
5442
|
}
|
|
5440
5443
|
consume(parser, context | 32, 16);
|
|
5441
5444
|
}
|
|
5442
|
-
additionalScope = scope?.createChildScope(32);
|
|
5445
|
+
const additionalScope = scope?.createChildScope(32);
|
|
5443
5446
|
const body = parseBlock(parser, context, additionalScope, privateScope, { $: labels });
|
|
5444
5447
|
return parser.finishNode({
|
|
5445
5448
|
type: 'CatchClause',
|
|
@@ -5477,7 +5480,8 @@ function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateS
|
|
|
5477
5480
|
const { tokenValue, tokenStart } = parser;
|
|
5478
5481
|
const token = parser.getToken();
|
|
5479
5482
|
let expr = parseIdentifier(parser, context);
|
|
5480
|
-
if (parser.getToken() & (143360 | 2097152)
|
|
5483
|
+
if (parser.getToken() & (143360 | 2097152) &&
|
|
5484
|
+
(parser.getToken() & 20480) !== 20480) {
|
|
5481
5485
|
const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 8, 0);
|
|
5482
5486
|
matchOrInsertSemicolon(parser, context | 32);
|
|
5483
5487
|
return parser.finishNode({
|
|
@@ -5590,18 +5594,13 @@ function parseForStatement(parser, context, scope, privateScope, labels) {
|
|
|
5590
5594
|
if (isVarDecl) {
|
|
5591
5595
|
if (token === 241737) {
|
|
5592
5596
|
init = parseIdentifier(parser, context);
|
|
5593
|
-
if (parser.getToken() & (143360 | 2097152)
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
type: 'VariableDeclaration',
|
|
5601
|
-
kind: 'let',
|
|
5602
|
-
declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 8, 32),
|
|
5603
|
-
}, tokenStart);
|
|
5604
|
-
}
|
|
5597
|
+
if (parser.getToken() & (143360 | 2097152) &&
|
|
5598
|
+
(parser.getToken() & 20480) !== 20480) {
|
|
5599
|
+
init = parser.finishNode({
|
|
5600
|
+
type: 'VariableDeclaration',
|
|
5601
|
+
kind: 'let',
|
|
5602
|
+
declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 8, 32),
|
|
5603
|
+
}, tokenStart);
|
|
5605
5604
|
parser.assignable = 1;
|
|
5606
5605
|
}
|
|
5607
5606
|
else if (context & 1) {
|
|
@@ -5722,7 +5721,7 @@ function parseRestrictedIdentifier(parser, context, scope) {
|
|
|
5722
5721
|
function parseImportDeclaration(parser, context, scope) {
|
|
5723
5722
|
const start = parser.tokenStart;
|
|
5724
5723
|
nextToken(parser, context);
|
|
5725
|
-
let source
|
|
5724
|
+
let source;
|
|
5726
5725
|
const { tokenStart } = parser;
|
|
5727
5726
|
let specifiers = [];
|
|
5728
5727
|
if (parser.getToken() === 134283267) {
|
|
@@ -6815,6 +6814,7 @@ function parseTemplate(parser, context, privateScope) {
|
|
|
6815
6814
|
consume(parser, context, 67174409);
|
|
6816
6815
|
quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true));
|
|
6817
6816
|
}
|
|
6817
|
+
parser.assignable = 2;
|
|
6818
6818
|
return parser.finishNode({
|
|
6819
6819
|
type: 'TemplateLiteral',
|
|
6820
6820
|
expressions,
|
|
@@ -8448,7 +8448,7 @@ function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee,
|
|
|
8448
8448
|
}, start);
|
|
8449
8449
|
}
|
|
8450
8450
|
let destructible = 0;
|
|
8451
|
-
let expr
|
|
8451
|
+
let expr;
|
|
8452
8452
|
let isNonSimpleParameterList = 0;
|
|
8453
8453
|
parser.destructible =
|
|
8454
8454
|
(parser.destructible | 256 | 128) ^
|
|
@@ -8758,6 +8758,9 @@ function parseClassElementList(parser, context, scope, privateScope, inheritedCo
|
|
|
8758
8758
|
break;
|
|
8759
8759
|
case 209008:
|
|
8760
8760
|
if (parser.getToken() !== 67174411) {
|
|
8761
|
+
if (parser.getToken() === 8391476 && parser.flags & 1) {
|
|
8762
|
+
return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);
|
|
8763
|
+
}
|
|
8761
8764
|
if ((parser.getToken() & 1073741824) === 1073741824) {
|
|
8762
8765
|
return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);
|
|
8763
8766
|
}
|
|
@@ -8766,6 +8769,9 @@ function parseClassElementList(parser, context, scope, privateScope, inheritedCo
|
|
|
8766
8769
|
break;
|
|
8767
8770
|
case 209009:
|
|
8768
8771
|
if (parser.getToken() !== 67174411) {
|
|
8772
|
+
if (parser.getToken() === 8391476 && parser.flags & 1) {
|
|
8773
|
+
return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);
|
|
8774
|
+
}
|
|
8769
8775
|
if ((parser.getToken() & 1073741824) === 1073741824) {
|
|
8770
8776
|
return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);
|
|
8771
8777
|
}
|
|
@@ -9228,7 +9234,7 @@ function parseJSXExpressionContainer(parser, context, privateScope, inJSXChild,
|
|
|
9228
9234
|
const { tokenStart } = parser;
|
|
9229
9235
|
if (parser.getToken() === 14)
|
|
9230
9236
|
return parseJSXSpreadChild(parser, context, privateScope, start);
|
|
9231
|
-
let expression
|
|
9237
|
+
let expression;
|
|
9232
9238
|
if (parser.getToken() === 1074790415) {
|
|
9233
9239
|
if (isAttr)
|
|
9234
9240
|
parser.report(157);
|
|
@@ -9282,7 +9288,7 @@ function parseJSXIdentifier(parser, context) {
|
|
|
9282
9288
|
}, start);
|
|
9283
9289
|
}
|
|
9284
9290
|
|
|
9285
|
-
const version =
|
|
9291
|
+
const { version } = packageJson;
|
|
9286
9292
|
function parseScript(source, options) {
|
|
9287
9293
|
return parseSource(source, { ...options, sourceType: 'script' });
|
|
9288
9294
|
}
|