meriyah 6.1.3 → 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 CHANGED
@@ -1,3 +1,33 @@
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
+
19
+ ## [6.1.4](https://github.com/meriyah/meriyah/compare/v6.1.3...v6.1.4) (2025-07-02)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * add missing `AccessorProperty` to `Node` ([#482](https://github.com/meriyah/meriyah/issues/482)) ([e6dcc62](https://github.com/meriyah/meriyah/commit/e6dcc62e3b6436ca626e18c621419e8da9f1f9c9))
25
+ * fix `decodeHTMLStrict()` ([#505](https://github.com/meriyah/meriyah/issues/505)) ([bd3ce8e](https://github.com/meriyah/meriyah/commit/bd3ce8e267f5941044436541e7488bee6ef4d850))
26
+ * **parser:** fix class member range with decorators ([#506](https://github.com/meriyah/meriyah/issues/506)) ([1dfa82c](https://github.com/meriyah/meriyah/commit/1dfa82cc3f6957a6013fee2fa137f6f09e9eb26d))
27
+ * **parser:** stop complaining about named import/export with `{type: "json"}` attribute ([#484](https://github.com/meriyah/meriyah/issues/484)) ([ab8a383](https://github.com/meriyah/meriyah/commit/ab8a3836336f7418b42ea22997141c211b097605))
28
+
29
+
30
+
1
31
  ## [6.1.3](https://github.com/meriyah/meriyah/compare/v6.1.2...v6.1.3) (2025-06-24)
2
32
 
3
33
 
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
- In addition, RegExp v flag (unicodeSets) only works on Nodejs v20+ and latest browsers.
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
- ```js
76
+ ```ts
77
77
  {
78
- // The flag to allow module code
79
- module: false;
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: false;
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: false;
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: false;
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: false;
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: false;
93
+ // The flag to attach raw property to each literal and identifier node, default `false`
94
+ raw: boolean;
95
95
 
96
- // The flag to allow return in the global scope
97
- globalReturn: false;
96
+ // The flag to enable implied strict mode, default `false`
97
+ impliedStrict: boolean;
98
98
 
99
- // The flag to enable implied strict mode
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: (pos) => {};
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: false;
108
+ // Enable non-standard parenthesized expression node, default `false`
109
+ preserveParens: boolean;
113
110
 
114
- // Enable lexical binding and scope tracking
115
- lexical: false;
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: undefined; // Set to source: 'source-file.js'
115
+ source: string; // Set to source: 'source-file.js'
116
+
117
+ // Enable React JSX parsing, default `false`
118
+ jsx: boolean;
119
119
 
120
- // Enable React JSX parsing
121
- jsx: false;
120
+ // Validate regular expressions with runtime, default `true`
121
+ validateRegex: boolean;
122
122
  }
123
123
  ```
124
124