oxc-parser 0.76.0 → 0.77.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.
@@ -1627,9 +1627,10 @@ function deserializeTSTypeAliasDeclaration(pos) {
1627
1627
  function deserializeTSClassImplements(pos) {
1628
1628
  let expression = deserializeTSTypeName(pos + 8);
1629
1629
  if (expression.type === 'TSQualifiedName') {
1630
+ let object = expression.left;
1630
1631
  let parent = expression = {
1631
1632
  type: 'MemberExpression',
1632
- object: expression.left,
1633
+ object,
1633
1634
  property: expression.right,
1634
1635
  optional: false,
1635
1636
  computed: false,
@@ -1637,17 +1638,18 @@ function deserializeTSClassImplements(pos) {
1637
1638
  end: expression.end,
1638
1639
  };
1639
1640
 
1640
- while (parent.object.type === 'TSQualifiedName') {
1641
- const object = parent.object;
1641
+ while (object.type === 'TSQualifiedName') {
1642
+ const { left } = object;
1642
1643
  parent = parent.object = {
1643
1644
  type: 'MemberExpression',
1644
- object: object.left,
1645
+ object: left,
1645
1646
  property: object.right,
1646
1647
  optional: false,
1647
1648
  computed: false,
1648
1649
  start: object.start,
1649
1650
  end: object.end,
1650
1651
  };
1652
+ object = left;
1651
1653
  }
1652
1654
  }
1653
1655
  return {
@@ -1758,9 +1758,10 @@ function deserializeTSTypeAliasDeclaration(pos) {
1758
1758
  function deserializeTSClassImplements(pos) {
1759
1759
  let expression = deserializeTSTypeName(pos + 8);
1760
1760
  if (expression.type === 'TSQualifiedName') {
1761
+ let object = expression.left;
1761
1762
  let parent = expression = {
1762
1763
  type: 'MemberExpression',
1763
- object: expression.left,
1764
+ object,
1764
1765
  property: expression.right,
1765
1766
  optional: false,
1766
1767
  computed: false,
@@ -1768,17 +1769,18 @@ function deserializeTSClassImplements(pos) {
1768
1769
  end: expression.end,
1769
1770
  };
1770
1771
 
1771
- while (parent.object.type === 'TSQualifiedName') {
1772
- const object = parent.object;
1772
+ while (object.type === 'TSQualifiedName') {
1773
+ const { left } = object;
1773
1774
  parent = parent.object = {
1774
1775
  type: 'MemberExpression',
1775
- object: object.left,
1776
+ object: left,
1776
1777
  property: object.right,
1777
1778
  optional: false,
1778
1779
  computed: false,
1779
1780
  start: object.start,
1780
1781
  end: object.end,
1781
1782
  };
1783
+ object = left;
1782
1784
  }
1783
1785
  }
1784
1786
  return {
package/index.d.ts CHANGED
@@ -137,8 +137,8 @@ export declare const enum ImportNameKind {
137
137
  export declare function parseAsync(filename: string, sourceText: string, options?: ParserOptions | undefined | null): Promise<ParseResult>
138
138
 
139
139
  export interface ParserOptions {
140
- /** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
141
- lang?: 'js' | 'jsx' | 'ts' | 'tsx'
140
+ /** Treat the source text as `js`, `jsx`, `ts`, `tsx` or `dts`. */
141
+ lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts'
142
142
  /** Treat the source text as `script` or `module` code. */
143
143
  sourceType?: 'script' | 'module' | 'unambiguous' | undefined
144
144
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxc-parser",
3
- "version": "0.76.0",
3
+ "version": "0.77.0",
4
4
  "main": "index.js",
5
5
  "browser": "wasm.mjs",
6
6
  "engines": {
@@ -49,7 +49,7 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@oxc-project/types": "^0.76.0"
52
+ "@oxc-project/types": "^0.77.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@codspeed/vitest-plugin": "^4.0.0",
@@ -89,24 +89,25 @@
89
89
  "dtsHeaderFile": "header.js"
90
90
  },
91
91
  "optionalDependencies": {
92
- "@oxc-parser/binding-win32-x64-msvc": "0.76.0",
93
- "@oxc-parser/binding-win32-arm64-msvc": "0.76.0",
94
- "@oxc-parser/binding-linux-x64-gnu": "0.76.0",
95
- "@oxc-parser/binding-linux-x64-musl": "0.76.0",
96
- "@oxc-parser/binding-freebsd-x64": "0.76.0",
97
- "@oxc-parser/binding-linux-arm64-gnu": "0.76.0",
98
- "@oxc-parser/binding-linux-arm64-musl": "0.76.0",
99
- "@oxc-parser/binding-linux-arm-gnueabihf": "0.76.0",
100
- "@oxc-parser/binding-linux-arm-musleabihf": "0.76.0",
101
- "@oxc-parser/binding-linux-s390x-gnu": "0.76.0",
102
- "@oxc-parser/binding-linux-riscv64-gnu": "0.76.0",
103
- "@oxc-parser/binding-darwin-x64": "0.76.0",
104
- "@oxc-parser/binding-darwin-arm64": "0.76.0",
105
- "@oxc-parser/binding-android-arm64": "0.76.0",
106
- "@oxc-parser/binding-wasm32-wasi": "0.76.0"
92
+ "@oxc-parser/binding-win32-x64-msvc": "0.77.0",
93
+ "@oxc-parser/binding-win32-arm64-msvc": "0.77.0",
94
+ "@oxc-parser/binding-linux-x64-gnu": "0.77.0",
95
+ "@oxc-parser/binding-linux-x64-musl": "0.77.0",
96
+ "@oxc-parser/binding-freebsd-x64": "0.77.0",
97
+ "@oxc-parser/binding-linux-arm64-gnu": "0.77.0",
98
+ "@oxc-parser/binding-linux-arm64-musl": "0.77.0",
99
+ "@oxc-parser/binding-linux-arm-gnueabihf": "0.77.0",
100
+ "@oxc-parser/binding-linux-arm-musleabihf": "0.77.0",
101
+ "@oxc-parser/binding-linux-s390x-gnu": "0.77.0",
102
+ "@oxc-parser/binding-linux-riscv64-gnu": "0.77.0",
103
+ "@oxc-parser/binding-darwin-x64": "0.77.0",
104
+ "@oxc-parser/binding-darwin-arm64": "0.77.0",
105
+ "@oxc-parser/binding-android-arm64": "0.77.0",
106
+ "@oxc-parser/binding-wasm32-wasi": "0.77.0"
107
107
  },
108
108
  "scripts": {
109
109
  "build-dev": "napi build --platform --js bindings.js",
110
+ "build-test": "pnpm run build",
110
111
  "build": "pnpm run build-dev --features allocator --release",
111
112
  "postbuild-dev": "node patch.mjs",
112
113
  "build-wasi": "pnpm run build-dev --release --target wasm32-wasip1-threads",