yuku-parser 0.4.4 → 0.4.6

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.
Files changed (3) hide show
  1. package/index.d.ts +6 -1
  2. package/index.js +1 -1
  3. package/package.json +12 -12
package/index.d.ts CHANGED
@@ -22,9 +22,14 @@ interface ParseOptions {
22
22
  * When true, parenthesized expressions are represented as
23
23
  * `ParenthesizedExpression` nodes in the AST. When false,
24
24
  * parentheses are stripped and only the inner expression is kept.
25
- * @default false
25
+ * @default true
26
26
  */
27
27
  preserveParens?: boolean;
28
+ /**
29
+ * Allow `return` statements outside of functions, at the top level.
30
+ * @default false
31
+ */
32
+ allowReturnOutsideFunction?: boolean;
28
33
  /**
29
34
  * Run semantic analysis after parsing and include semantic errors
30
35
  * (e.g. duplicate declarations, invalid `break`/`continue` targets)
package/index.js CHANGED
@@ -2,6 +2,6 @@ import binding from "./binding.js";
2
2
  import { decode } from "./decode.js";
3
3
 
4
4
  export function parse(source, options) {
5
- const buffer = binding.parseSync(source, options ?? {});
5
+ const buffer = binding.parse(source, options ?? {});
6
6
  return decode(buffer, source);
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuku-parser",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "High-performance JavaScript/TypeScript parser",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,16 +17,16 @@
17
17
  "main": "index.js",
18
18
  "types": "index.d.ts",
19
19
  "optionalDependencies": {
20
- "@yuku-parser/binding-darwin-arm64": "0.4.4",
21
- "@yuku-parser/binding-darwin-x64": "0.4.4",
22
- "@yuku-parser/binding-freebsd-x64": "0.4.4",
23
- "@yuku-parser/binding-linux-arm-gnu": "0.4.4",
24
- "@yuku-parser/binding-linux-arm-musl": "0.4.4",
25
- "@yuku-parser/binding-linux-arm64-gnu": "0.4.4",
26
- "@yuku-parser/binding-linux-arm64-musl": "0.4.4",
27
- "@yuku-parser/binding-linux-x64-gnu": "0.4.4",
28
- "@yuku-parser/binding-linux-x64-musl": "0.4.4",
29
- "@yuku-parser/binding-win32-arm64": "0.4.4",
30
- "@yuku-parser/binding-win32-x64": "0.4.4"
20
+ "@yuku-parser/binding-darwin-arm64": "0.4.6",
21
+ "@yuku-parser/binding-darwin-x64": "0.4.6",
22
+ "@yuku-parser/binding-freebsd-x64": "0.4.6",
23
+ "@yuku-parser/binding-linux-arm-gnu": "0.4.6",
24
+ "@yuku-parser/binding-linux-arm-musl": "0.4.6",
25
+ "@yuku-parser/binding-linux-arm64-gnu": "0.4.6",
26
+ "@yuku-parser/binding-linux-arm64-musl": "0.4.6",
27
+ "@yuku-parser/binding-linux-x64-gnu": "0.4.6",
28
+ "@yuku-parser/binding-linux-x64-musl": "0.4.6",
29
+ "@yuku-parser/binding-win32-arm64": "0.4.6",
30
+ "@yuku-parser/binding-win32-x64": "0.4.6"
31
31
  }
32
32
  }