meriyah 6.1.4 → 7.0.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 +18 -0
- package/README.md +31 -31
- package/dist/meriyah.cjs +1068 -1059
- package/dist/meriyah.min.mjs +1 -1
- package/dist/meriyah.mjs +1068 -1059
- package/dist/meriyah.umd.js +9192 -9183
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/types/common.d.ts +1 -2
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/estree.d.ts +36 -22
- package/dist/types/lexer/comments.d.ts +1 -1
- package/dist/types/lexer/common.d.ts +1 -1
- package/dist/types/lexer/identifier.d.ts +1 -1
- package/dist/types/lexer/jsx.d.ts +1 -1
- package/dist/types/lexer/scan.d.ts +1 -1
- package/dist/types/meriyah.d.ts +2 -2
- package/dist/types/options.d.ts +7 -4
- package/dist/types/parser/parser.d.ts +10 -9
- package/dist/types/parser/private-scope.d.ts +1 -1
- package/dist/types/parser/scope.d.ts +1 -1
- package/dist/types/parser.d.ts +1 -6
- package/dist/types/utilities.d.ts +1 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# [7.0.0](https://github.com/meriyah/meriyah/compare/v6.1.4...v7.0.0) (2025-11-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* allow `new.target` in `commonjs` module root ([#524](https://github.com/meriyah/meriyah/issues/524)) ([5053d99](https://github.com/meriyah/meriyah/commit/5053d99dce77ea86edfc0ee33c94654078dd25ab))
|
|
7
|
+
* fix start location of `HTMLClose` comment ([#522](https://github.com/meriyah/meriyah/issues/522)) ([5ea7b96](https://github.com/meriyah/meriyah/commit/5ea7b96fab1f47a7aac39eaf69ba9c973108874e))
|
|
8
|
+
* **parser:** generate unique location info for shorthand pattern ([#515](https://github.com/meriyah/meriyah/issues/515)) ([42bb9bc](https://github.com/meriyah/meriyah/commit/42bb9bcc4fdbb3b384d98643890c8864cb557f8a))
|
|
9
|
+
* remove misspelled `ForInitialiser` in ESTree ([#520](https://github.com/meriyah/meriyah/issues/520)) ([2349d2c](https://github.com/meriyah/meriyah/commit/2349d2c901e03faf735c62eaf04aad2d3b0cd14a))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* allow skip regular expression validation ([#346](https://github.com/meriyah/meriyah/issues/346)) ([224d167](https://github.com/meriyah/meriyah/commit/224d167a3d3361d360a16f2b63a6a2ca1ea694b0))
|
|
15
|
+
* support unicode 17 ([#532](https://github.com/meriyah/meriyah/issues/532)) ([de36a18](https://github.com/meriyah/meriyah/commit/de36a1894c8098695f2a80bd1092dc627ded6dec))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
## [6.1.4](https://github.com/meriyah/meriyah/compare/v6.1.3...v6.1.4) (2025-07-02)
|
|
2
20
|
|
|
3
21
|
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ These features need to be enabled with the `next` option.
|
|
|
43
43
|
## RegExp support
|
|
44
44
|
|
|
45
45
|
Meriyah doesn't parse RegExp internal syntax, ESTree spec didn't require internal structure of RegExp. Meriyah
|
|
46
|
-
does use JavaScript runtime to validate the RegExp literal. That means Meriyah's RegExp support is only as good
|
|
46
|
+
does use JavaScript runtime to validate the RegExp literal by default. That means Meriyah's RegExp support is only as good
|
|
47
47
|
as JavaScript runtime's RegExp support.
|
|
48
48
|
|
|
49
49
|
As of May 2025, some latest RegExp features requires Node.js>=24.
|
|
@@ -51,7 +51,7 @@ As of May 2025, some latest RegExp features requires Node.js>=24.
|
|
|
51
51
|
- [RegExp modifiers](https://github.com/tc39/proposal-regexp-modifiers)
|
|
52
52
|
- [RegExp duplicate named groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups)
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Use `validateRegex: false` if you want consistent behavior in different environments or don't need errors for invalid RegExp.
|
|
55
55
|
|
|
56
56
|
## Installation
|
|
57
57
|
|
|
@@ -73,52 +73,52 @@ const result = parse('let some = "code";', { ranges: true });
|
|
|
73
73
|
|
|
74
74
|
The available options:
|
|
75
75
|
|
|
76
|
-
```
|
|
76
|
+
```ts
|
|
77
77
|
{
|
|
78
|
-
//
|
|
79
|
-
|
|
78
|
+
// Indicate the mode the code should be parsed in 'script', 'module', or 'commonjs' mode, default `'script'`
|
|
79
|
+
sourceType: 'script' | 'module' | 'commonjs';
|
|
80
80
|
|
|
81
|
-
// The flag to enable stage 3 support (ESNext)
|
|
82
|
-
next:
|
|
81
|
+
// The flag to enable stage 3 support (ESNext), default `false`
|
|
82
|
+
next: boolean;
|
|
83
83
|
|
|
84
|
-
// The flag to enable start, end offsets and range: [start, end] to each node
|
|
85
|
-
ranges:
|
|
84
|
+
// The flag to enable start, end offsets and range: [start, end] to each node, default `false`
|
|
85
|
+
ranges: boolean;
|
|
86
86
|
|
|
87
|
-
// Enable web compatibility
|
|
88
|
-
webcompat:
|
|
87
|
+
// Enable web compatibility, default `false`
|
|
88
|
+
webcompat: boolean;
|
|
89
89
|
|
|
90
|
-
// The flag to enable line/column location information to each node
|
|
91
|
-
loc:
|
|
90
|
+
// The flag to enable line/column location information to each node, default `false`
|
|
91
|
+
loc: boolean;
|
|
92
92
|
|
|
93
|
-
// The flag to attach raw property to each literal and identifier node
|
|
94
|
-
raw:
|
|
93
|
+
// The flag to attach raw property to each literal and identifier node, default `false`
|
|
94
|
+
raw: boolean;
|
|
95
95
|
|
|
96
|
-
// The flag to
|
|
97
|
-
|
|
96
|
+
// The flag to enable implied strict mode, default `false`
|
|
97
|
+
impliedStrict: boolean;
|
|
98
98
|
|
|
99
|
-
//
|
|
100
|
-
impliedStrict: false;
|
|
101
|
-
|
|
102
|
-
// Allows comment extraction. Accepts either a function or array
|
|
99
|
+
// Allows comment extraction. Accepts either a function or array, default `undefined`
|
|
103
100
|
onComment: [];
|
|
104
101
|
|
|
105
|
-
// Allows detection of automatic semicolon insertion. Accepts a callback function that will be passed the character offset where the semicolon was inserted
|
|
106
|
-
onInsertedSemicolon: (
|
|
102
|
+
// Allows detection of automatic semicolon insertion. Accepts a callback function that will be passed the character offset where the semicolon was inserted, default `undefined`
|
|
103
|
+
onInsertedSemicolon: (position: number) => {};
|
|
107
104
|
|
|
108
|
-
// Allows token extraction. Accepts either a function or array
|
|
105
|
+
// Allows token extraction. Accepts either a function or array, default `undefined`
|
|
109
106
|
onToken: [];
|
|
110
107
|
|
|
111
|
-
// Enable non-standard parenthesized expression node
|
|
112
|
-
preserveParens:
|
|
108
|
+
// Enable non-standard parenthesized expression node, default `false`
|
|
109
|
+
preserveParens: boolean;
|
|
113
110
|
|
|
114
|
-
// Enable lexical binding and scope tracking
|
|
115
|
-
lexical:
|
|
111
|
+
// Enable lexical binding and scope tracking, default `false`
|
|
112
|
+
lexical: boolean;
|
|
116
113
|
|
|
117
114
|
// Adds a source attribute in every node’s loc object when the locations option is `true`
|
|
118
|
-
source:
|
|
115
|
+
source: string; // Set to source: 'source-file.js'
|
|
116
|
+
|
|
117
|
+
// Enable React JSX parsing, default `false`
|
|
118
|
+
jsx: boolean;
|
|
119
119
|
|
|
120
|
-
//
|
|
121
|
-
|
|
120
|
+
// Validate regular expressions with runtime, default `true`
|
|
121
|
+
validateRegex: boolean;
|
|
122
122
|
}
|
|
123
123
|
```
|
|
124
124
|
|