oxc-parser 0.79.0 → 0.80.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.
@@ -323,7 +323,7 @@ function deserializeAssignmentExpression(pos) {
323
323
 
324
324
  function deserializeArrayAssignmentTarget(pos) {
325
325
  const elements = deserializeVecOptionAssignmentTargetMaybeDefault(pos + 8);
326
- const rest = deserializeOptionAssignmentTargetRest(pos + 32);
326
+ const rest = deserializeOptionBoxAssignmentTargetRest(pos + 32);
327
327
  if (rest !== null) elements.push(rest);
328
328
  return {
329
329
  type: 'ArrayPattern',
@@ -335,7 +335,7 @@ function deserializeArrayAssignmentTarget(pos) {
335
335
 
336
336
  function deserializeObjectAssignmentTarget(pos) {
337
337
  const properties = deserializeVecAssignmentTargetProperty(pos + 8);
338
- const rest = deserializeOptionAssignmentTargetRest(pos + 32);
338
+ const rest = deserializeOptionBoxAssignmentTargetRest(pos + 32);
339
339
  if (rest !== null) properties.push(rest);
340
340
  return {
341
341
  type: 'ObjectPattern',
@@ -957,7 +957,7 @@ function deserializeImportNamespaceSpecifier(pos) {
957
957
 
958
958
  function deserializeWithClause(pos) {
959
959
  return {
960
- attributes: deserializeVecImportAttribute(pos + 32),
960
+ attributes: deserializeVecImportAttribute(pos + 8),
961
961
  };
962
962
  }
963
963
 
@@ -4389,9 +4389,13 @@ function deserializeVecOptionAssignmentTargetMaybeDefault(pos) {
4389
4389
  return arr;
4390
4390
  }
4391
4391
 
4392
- function deserializeOptionAssignmentTargetRest(pos) {
4393
- if (uint8[pos + 8] === 51) return null;
4394
- return deserializeAssignmentTargetRest(pos);
4392
+ function deserializeBoxAssignmentTargetRest(pos) {
4393
+ return deserializeAssignmentTargetRest(uint32[pos >> 2]);
4394
+ }
4395
+
4396
+ function deserializeOptionBoxAssignmentTargetRest(pos) {
4397
+ if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
4398
+ return deserializeBoxAssignmentTargetRest(pos);
4395
4399
  }
4396
4400
 
4397
4401
  function deserializeVecAssignmentTargetProperty(pos) {
@@ -355,7 +355,7 @@ function deserializeAssignmentExpression(pos) {
355
355
 
356
356
  function deserializeArrayAssignmentTarget(pos) {
357
357
  const elements = deserializeVecOptionAssignmentTargetMaybeDefault(pos + 8);
358
- const rest = deserializeOptionAssignmentTargetRest(pos + 32);
358
+ const rest = deserializeOptionBoxAssignmentTargetRest(pos + 32);
359
359
  if (rest !== null) elements.push(rest);
360
360
  return {
361
361
  type: 'ArrayPattern',
@@ -370,7 +370,7 @@ function deserializeArrayAssignmentTarget(pos) {
370
370
 
371
371
  function deserializeObjectAssignmentTarget(pos) {
372
372
  const properties = deserializeVecAssignmentTargetProperty(pos + 8);
373
- const rest = deserializeOptionAssignmentTargetRest(pos + 32);
373
+ const rest = deserializeOptionBoxAssignmentTargetRest(pos + 32);
374
374
  if (rest !== null) properties.push(rest);
375
375
  return {
376
376
  type: 'ObjectPattern',
@@ -1085,7 +1085,7 @@ function deserializeImportNamespaceSpecifier(pos) {
1085
1085
 
1086
1086
  function deserializeWithClause(pos) {
1087
1087
  return {
1088
- attributes: deserializeVecImportAttribute(pos + 32),
1088
+ attributes: deserializeVecImportAttribute(pos + 8),
1089
1089
  };
1090
1090
  }
1091
1091
 
@@ -4520,9 +4520,13 @@ function deserializeVecOptionAssignmentTargetMaybeDefault(pos) {
4520
4520
  return arr;
4521
4521
  }
4522
4522
 
4523
- function deserializeOptionAssignmentTargetRest(pos) {
4524
- if (uint8[pos + 8] === 51) return null;
4525
- return deserializeAssignmentTargetRest(pos);
4523
+ function deserializeBoxAssignmentTargetRest(pos) {
4524
+ return deserializeAssignmentTargetRest(uint32[pos >> 2]);
4525
+ }
4526
+
4527
+ function deserializeOptionBoxAssignmentTargetRest(pos) {
4528
+ if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
4529
+ return deserializeBoxAssignmentTargetRest(pos);
4526
4530
  }
4527
4531
 
4528
4532
  function deserializeVecAssignmentTargetProperty(pos) {
@@ -5787,7 +5787,7 @@ class WithClause {
5787
5787
  const internal = this.#internal,
5788
5788
  cached = internal.$attributes;
5789
5789
  if (cached !== void 0) return cached;
5790
- return internal.$attributes = constructVecImportAttribute(internal.pos + 32, internal.ast);
5790
+ return internal.$attributes = constructVecImportAttribute(internal.pos + 8, internal.ast);
5791
5791
  }
5792
5792
 
5793
5793
  toJSON() {
@@ -12855,9 +12855,13 @@ function constructVecOptionAssignmentTargetMaybeDefault(pos, ast) {
12855
12855
  );
12856
12856
  }
12857
12857
 
12858
- function constructOptionAssignmentTargetRest(pos, ast) {
12859
- if (ast.buffer[pos + 8] === 51) return null;
12860
- return new AssignmentTargetRest(pos, ast);
12858
+ function constructBoxAssignmentTargetRest(pos, ast) {
12859
+ return new AssignmentTargetRest(ast.buffer.uint32[pos >> 2], ast);
12860
+ }
12861
+
12862
+ function constructOptionBoxAssignmentTargetRest(pos, ast) {
12863
+ if (ast.buffer.uint32[pos >> 2] === 0 && ast.buffer.uint32[(pos + 4) >> 2] === 0) return null;
12864
+ return constructBoxAssignmentTargetRest(pos, ast);
12861
12865
  }
12862
12866
 
12863
12867
  function constructVecAssignmentTargetProperty(pos, ast) {
@@ -2380,7 +2380,7 @@ function walkImportNamespaceSpecifier(pos, ast, visitors) {
2380
2380
  }
2381
2381
 
2382
2382
  function walkWithClause(pos, ast, visitors) {
2383
- walkVecImportAttribute(pos + 32, ast, visitors);
2383
+ walkVecImportAttribute(pos + 8, ast, visitors);
2384
2384
  }
2385
2385
 
2386
2386
  function walkImportAttribute(pos, ast, visitors) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxc-parser",
3
- "version": "0.79.0",
3
+ "version": "0.80.0",
4
4
  "main": "index.js",
5
5
  "browser": "wasm.mjs",
6
6
  "engines": {
@@ -50,7 +50,7 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@oxc-project/types": "^0.79.0"
53
+ "@oxc-project/types": "^0.80.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@codspeed/vitest-plugin": "^4.0.0",
@@ -90,25 +90,25 @@
90
90
  "dtsHeaderFile": "header.js"
91
91
  },
92
92
  "optionalDependencies": {
93
- "@oxc-parser/binding-win32-x64-msvc": "0.79.0",
94
- "@oxc-parser/binding-win32-arm64-msvc": "0.79.0",
95
- "@oxc-parser/binding-linux-x64-gnu": "0.79.0",
96
- "@oxc-parser/binding-linux-x64-musl": "0.79.0",
97
- "@oxc-parser/binding-freebsd-x64": "0.79.0",
98
- "@oxc-parser/binding-linux-arm64-gnu": "0.79.0",
99
- "@oxc-parser/binding-linux-arm64-musl": "0.79.0",
100
- "@oxc-parser/binding-linux-arm-gnueabihf": "0.79.0",
101
- "@oxc-parser/binding-linux-arm-musleabihf": "0.79.0",
102
- "@oxc-parser/binding-linux-s390x-gnu": "0.79.0",
103
- "@oxc-parser/binding-linux-riscv64-gnu": "0.79.0",
104
- "@oxc-parser/binding-darwin-x64": "0.79.0",
105
- "@oxc-parser/binding-darwin-arm64": "0.79.0",
106
- "@oxc-parser/binding-android-arm64": "0.79.0",
107
- "@oxc-parser/binding-wasm32-wasi": "0.79.0"
93
+ "@oxc-parser/binding-win32-x64-msvc": "0.80.0",
94
+ "@oxc-parser/binding-win32-arm64-msvc": "0.80.0",
95
+ "@oxc-parser/binding-linux-x64-gnu": "0.80.0",
96
+ "@oxc-parser/binding-linux-x64-musl": "0.80.0",
97
+ "@oxc-parser/binding-freebsd-x64": "0.80.0",
98
+ "@oxc-parser/binding-linux-arm64-gnu": "0.80.0",
99
+ "@oxc-parser/binding-linux-arm64-musl": "0.80.0",
100
+ "@oxc-parser/binding-linux-arm-gnueabihf": "0.80.0",
101
+ "@oxc-parser/binding-linux-arm-musleabihf": "0.80.0",
102
+ "@oxc-parser/binding-linux-s390x-gnu": "0.80.0",
103
+ "@oxc-parser/binding-linux-riscv64-gnu": "0.80.0",
104
+ "@oxc-parser/binding-darwin-x64": "0.80.0",
105
+ "@oxc-parser/binding-darwin-arm64": "0.80.0",
106
+ "@oxc-parser/binding-android-arm64": "0.80.0",
107
+ "@oxc-parser/binding-wasm32-wasi": "0.80.0"
108
108
  },
109
109
  "scripts": {
110
110
  "build-dev": "napi build --platform --js bindings.js",
111
- "build-test": "pnpm run build",
111
+ "build-test": "pnpm run build-dev --profile coverage",
112
112
  "build": "pnpm run build-dev --features allocator --release",
113
113
  "postbuild-dev": "node patch.mjs",
114
114
  "build-wasi": "pnpm run build-dev --release --target wasm32-wasip1-threads",