oxc-parser 0.89.0 → 0.90.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/bindings.mjs +50 -50
- package/generated/deserialize/js.mjs +13 -8
- package/generated/deserialize/ts.mjs +13 -8
- package/package.json +18 -18
- package/raw-transfer/common.mjs +5 -7
- package/raw-transfer/eager.mjs +9 -2
package/bindings.mjs
CHANGED
|
@@ -81,8 +81,8 @@ function requireNative() {
|
|
|
81
81
|
try {
|
|
82
82
|
const binding = require('@oxc-parser/binding-android-arm64')
|
|
83
83
|
const bindingPackageVersion = require('@oxc-parser/binding-android-arm64/package.json').version
|
|
84
|
-
if (bindingPackageVersion !== '0.
|
|
85
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
84
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
85
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
86
86
|
}
|
|
87
87
|
return binding
|
|
88
88
|
} catch (e) {
|
|
@@ -97,8 +97,8 @@ function requireNative() {
|
|
|
97
97
|
try {
|
|
98
98
|
const binding = require('@oxc-parser/binding-android-arm-eabi')
|
|
99
99
|
const bindingPackageVersion = require('@oxc-parser/binding-android-arm-eabi/package.json').version
|
|
100
|
-
if (bindingPackageVersion !== '0.
|
|
101
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
100
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
102
|
}
|
|
103
103
|
return binding
|
|
104
104
|
} catch (e) {
|
|
@@ -117,8 +117,8 @@ function requireNative() {
|
|
|
117
117
|
try {
|
|
118
118
|
const binding = require('@oxc-parser/binding-win32-x64-msvc')
|
|
119
119
|
const bindingPackageVersion = require('@oxc-parser/binding-win32-x64-msvc/package.json').version
|
|
120
|
-
if (bindingPackageVersion !== '0.
|
|
121
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
120
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
121
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
122
122
|
}
|
|
123
123
|
return binding
|
|
124
124
|
} catch (e) {
|
|
@@ -133,8 +133,8 @@ function requireNative() {
|
|
|
133
133
|
try {
|
|
134
134
|
const binding = require('@oxc-parser/binding-win32-ia32-msvc')
|
|
135
135
|
const bindingPackageVersion = require('@oxc-parser/binding-win32-ia32-msvc/package.json').version
|
|
136
|
-
if (bindingPackageVersion !== '0.
|
|
137
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
136
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
137
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
138
138
|
}
|
|
139
139
|
return binding
|
|
140
140
|
} catch (e) {
|
|
@@ -149,8 +149,8 @@ function requireNative() {
|
|
|
149
149
|
try {
|
|
150
150
|
const binding = require('@oxc-parser/binding-win32-arm64-msvc')
|
|
151
151
|
const bindingPackageVersion = require('@oxc-parser/binding-win32-arm64-msvc/package.json').version
|
|
152
|
-
if (bindingPackageVersion !== '0.
|
|
153
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
152
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
153
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
154
154
|
}
|
|
155
155
|
return binding
|
|
156
156
|
} catch (e) {
|
|
@@ -168,8 +168,8 @@ function requireNative() {
|
|
|
168
168
|
try {
|
|
169
169
|
const binding = require('@oxc-parser/binding-darwin-universal')
|
|
170
170
|
const bindingPackageVersion = require('@oxc-parser/binding-darwin-universal/package.json').version
|
|
171
|
-
if (bindingPackageVersion !== '0.
|
|
172
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
171
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
172
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
173
173
|
}
|
|
174
174
|
return binding
|
|
175
175
|
} catch (e) {
|
|
@@ -184,8 +184,8 @@ function requireNative() {
|
|
|
184
184
|
try {
|
|
185
185
|
const binding = require('@oxc-parser/binding-darwin-x64')
|
|
186
186
|
const bindingPackageVersion = require('@oxc-parser/binding-darwin-x64/package.json').version
|
|
187
|
-
if (bindingPackageVersion !== '0.
|
|
188
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
187
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
188
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
189
189
|
}
|
|
190
190
|
return binding
|
|
191
191
|
} catch (e) {
|
|
@@ -200,8 +200,8 @@ function requireNative() {
|
|
|
200
200
|
try {
|
|
201
201
|
const binding = require('@oxc-parser/binding-darwin-arm64')
|
|
202
202
|
const bindingPackageVersion = require('@oxc-parser/binding-darwin-arm64/package.json').version
|
|
203
|
-
if (bindingPackageVersion !== '0.
|
|
204
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
203
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
204
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
205
205
|
}
|
|
206
206
|
return binding
|
|
207
207
|
} catch (e) {
|
|
@@ -220,8 +220,8 @@ function requireNative() {
|
|
|
220
220
|
try {
|
|
221
221
|
const binding = require('@oxc-parser/binding-freebsd-x64')
|
|
222
222
|
const bindingPackageVersion = require('@oxc-parser/binding-freebsd-x64/package.json').version
|
|
223
|
-
if (bindingPackageVersion !== '0.
|
|
224
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
223
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
224
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
225
225
|
}
|
|
226
226
|
return binding
|
|
227
227
|
} catch (e) {
|
|
@@ -236,8 +236,8 @@ function requireNative() {
|
|
|
236
236
|
try {
|
|
237
237
|
const binding = require('@oxc-parser/binding-freebsd-arm64')
|
|
238
238
|
const bindingPackageVersion = require('@oxc-parser/binding-freebsd-arm64/package.json').version
|
|
239
|
-
if (bindingPackageVersion !== '0.
|
|
240
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
239
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
240
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
241
241
|
}
|
|
242
242
|
return binding
|
|
243
243
|
} catch (e) {
|
|
@@ -257,8 +257,8 @@ function requireNative() {
|
|
|
257
257
|
try {
|
|
258
258
|
const binding = require('@oxc-parser/binding-linux-x64-musl')
|
|
259
259
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-x64-musl/package.json').version
|
|
260
|
-
if (bindingPackageVersion !== '0.
|
|
261
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
260
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
261
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
262
262
|
}
|
|
263
263
|
return binding
|
|
264
264
|
} catch (e) {
|
|
@@ -273,8 +273,8 @@ function requireNative() {
|
|
|
273
273
|
try {
|
|
274
274
|
const binding = require('@oxc-parser/binding-linux-x64-gnu')
|
|
275
275
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-x64-gnu/package.json').version
|
|
276
|
-
if (bindingPackageVersion !== '0.
|
|
277
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
276
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
277
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
278
278
|
}
|
|
279
279
|
return binding
|
|
280
280
|
} catch (e) {
|
|
@@ -291,8 +291,8 @@ function requireNative() {
|
|
|
291
291
|
try {
|
|
292
292
|
const binding = require('@oxc-parser/binding-linux-arm64-musl')
|
|
293
293
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-arm64-musl/package.json').version
|
|
294
|
-
if (bindingPackageVersion !== '0.
|
|
295
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
294
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
295
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
296
|
}
|
|
297
297
|
return binding
|
|
298
298
|
} catch (e) {
|
|
@@ -307,8 +307,8 @@ function requireNative() {
|
|
|
307
307
|
try {
|
|
308
308
|
const binding = require('@oxc-parser/binding-linux-arm64-gnu')
|
|
309
309
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-arm64-gnu/package.json').version
|
|
310
|
-
if (bindingPackageVersion !== '0.
|
|
311
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
310
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
311
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
312
312
|
}
|
|
313
313
|
return binding
|
|
314
314
|
} catch (e) {
|
|
@@ -325,8 +325,8 @@ function requireNative() {
|
|
|
325
325
|
try {
|
|
326
326
|
const binding = require('@oxc-parser/binding-linux-arm-musleabihf')
|
|
327
327
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-arm-musleabihf/package.json').version
|
|
328
|
-
if (bindingPackageVersion !== '0.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
328
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
330
330
|
}
|
|
331
331
|
return binding
|
|
332
332
|
} catch (e) {
|
|
@@ -341,8 +341,8 @@ function requireNative() {
|
|
|
341
341
|
try {
|
|
342
342
|
const binding = require('@oxc-parser/binding-linux-arm-gnueabihf')
|
|
343
343
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-arm-gnueabihf/package.json').version
|
|
344
|
-
if (bindingPackageVersion !== '0.
|
|
345
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
344
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
345
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
346
346
|
}
|
|
347
347
|
return binding
|
|
348
348
|
} catch (e) {
|
|
@@ -359,8 +359,8 @@ function requireNative() {
|
|
|
359
359
|
try {
|
|
360
360
|
const binding = require('@oxc-parser/binding-linux-loong64-musl')
|
|
361
361
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-loong64-musl/package.json').version
|
|
362
|
-
if (bindingPackageVersion !== '0.
|
|
363
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
362
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
363
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
364
364
|
}
|
|
365
365
|
return binding
|
|
366
366
|
} catch (e) {
|
|
@@ -375,8 +375,8 @@ function requireNative() {
|
|
|
375
375
|
try {
|
|
376
376
|
const binding = require('@oxc-parser/binding-linux-loong64-gnu')
|
|
377
377
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-loong64-gnu/package.json').version
|
|
378
|
-
if (bindingPackageVersion !== '0.
|
|
379
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
378
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
379
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
380
380
|
}
|
|
381
381
|
return binding
|
|
382
382
|
} catch (e) {
|
|
@@ -393,8 +393,8 @@ function requireNative() {
|
|
|
393
393
|
try {
|
|
394
394
|
const binding = require('@oxc-parser/binding-linux-riscv64-musl')
|
|
395
395
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-riscv64-musl/package.json').version
|
|
396
|
-
if (bindingPackageVersion !== '0.
|
|
397
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
396
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
397
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
398
398
|
}
|
|
399
399
|
return binding
|
|
400
400
|
} catch (e) {
|
|
@@ -409,8 +409,8 @@ function requireNative() {
|
|
|
409
409
|
try {
|
|
410
410
|
const binding = require('@oxc-parser/binding-linux-riscv64-gnu')
|
|
411
411
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-riscv64-gnu/package.json').version
|
|
412
|
-
if (bindingPackageVersion !== '0.
|
|
413
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
412
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
413
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
414
414
|
}
|
|
415
415
|
return binding
|
|
416
416
|
} catch (e) {
|
|
@@ -426,8 +426,8 @@ function requireNative() {
|
|
|
426
426
|
try {
|
|
427
427
|
const binding = require('@oxc-parser/binding-linux-ppc64-gnu')
|
|
428
428
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-ppc64-gnu/package.json').version
|
|
429
|
-
if (bindingPackageVersion !== '0.
|
|
430
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
429
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
430
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
431
431
|
}
|
|
432
432
|
return binding
|
|
433
433
|
} catch (e) {
|
|
@@ -442,8 +442,8 @@ function requireNative() {
|
|
|
442
442
|
try {
|
|
443
443
|
const binding = require('@oxc-parser/binding-linux-s390x-gnu')
|
|
444
444
|
const bindingPackageVersion = require('@oxc-parser/binding-linux-s390x-gnu/package.json').version
|
|
445
|
-
if (bindingPackageVersion !== '0.
|
|
446
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
445
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
446
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
447
447
|
}
|
|
448
448
|
return binding
|
|
449
449
|
} catch (e) {
|
|
@@ -462,8 +462,8 @@ function requireNative() {
|
|
|
462
462
|
try {
|
|
463
463
|
const binding = require('@oxc-parser/binding-openharmony-arm64')
|
|
464
464
|
const bindingPackageVersion = require('@oxc-parser/binding-openharmony-arm64/package.json').version
|
|
465
|
-
if (bindingPackageVersion !== '0.
|
|
466
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
465
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
466
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
467
467
|
}
|
|
468
468
|
return binding
|
|
469
469
|
} catch (e) {
|
|
@@ -478,8 +478,8 @@ function requireNative() {
|
|
|
478
478
|
try {
|
|
479
479
|
const binding = require('@oxc-parser/binding-openharmony-x64')
|
|
480
480
|
const bindingPackageVersion = require('@oxc-parser/binding-openharmony-x64/package.json').version
|
|
481
|
-
if (bindingPackageVersion !== '0.
|
|
482
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
481
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
482
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
483
483
|
}
|
|
484
484
|
return binding
|
|
485
485
|
} catch (e) {
|
|
@@ -494,8 +494,8 @@ function requireNative() {
|
|
|
494
494
|
try {
|
|
495
495
|
const binding = require('@oxc-parser/binding-openharmony-arm')
|
|
496
496
|
const bindingPackageVersion = require('@oxc-parser/binding-openharmony-arm/package.json').version
|
|
497
|
-
if (bindingPackageVersion !== '0.
|
|
498
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
497
|
+
if (bindingPackageVersion !== '0.89.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
498
|
+
throw new Error(`Native binding package version mismatch, expected 0.89.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
499
499
|
}
|
|
500
500
|
return binding
|
|
501
501
|
} catch (e) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
|
2
2
|
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs`.
|
|
3
3
|
|
|
4
|
-
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen;
|
|
4
|
+
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen, preserveParens;
|
|
5
5
|
|
|
6
6
|
const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true }),
|
|
7
7
|
decodeStr = textDecoder.decode.bind(textDecoder),
|
|
8
8
|
{ fromCodePoint } = String;
|
|
9
9
|
|
|
10
|
-
export function deserialize(buffer, sourceTextInput, sourceByteLenInput) {
|
|
10
|
+
export function deserialize(buffer, sourceTextInput, sourceByteLenInput, preserveParensInput) {
|
|
11
11
|
uint8 = buffer;
|
|
12
12
|
uint32 = buffer.uint32;
|
|
13
13
|
float64 = buffer.float64;
|
|
@@ -15,6 +15,7 @@ export function deserialize(buffer, sourceTextInput, sourceByteLenInput) {
|
|
|
15
15
|
sourceText = sourceTextInput;
|
|
16
16
|
sourceByteLen = sourceByteLenInput;
|
|
17
17
|
sourceIsAscii = sourceText.length === sourceByteLen;
|
|
18
|
+
preserveParens = preserveParensInput;
|
|
18
19
|
|
|
19
20
|
const data = deserializeRawTransferData(uint32[536870902]);
|
|
20
21
|
|
|
@@ -438,12 +439,16 @@ function deserializeChainExpression(pos) {
|
|
|
438
439
|
}
|
|
439
440
|
|
|
440
441
|
function deserializeParenthesizedExpression(pos) {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
442
|
+
let node = deserializeExpression(pos + 8);
|
|
443
|
+
if (preserveParens) {
|
|
444
|
+
node = {
|
|
445
|
+
type: 'ParenthesizedExpression',
|
|
446
|
+
expression: node,
|
|
447
|
+
start: deserializeU32(pos),
|
|
448
|
+
end: deserializeU32(pos + 4),
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
return node;
|
|
447
452
|
}
|
|
448
453
|
|
|
449
454
|
function deserializeDirective(pos) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
|
2
2
|
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs`.
|
|
3
3
|
|
|
4
|
-
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen;
|
|
4
|
+
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen, preserveParens;
|
|
5
5
|
|
|
6
6
|
const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true }),
|
|
7
7
|
decodeStr = textDecoder.decode.bind(textDecoder),
|
|
8
8
|
{ fromCodePoint } = String;
|
|
9
9
|
|
|
10
|
-
export function deserialize(buffer, sourceTextInput, sourceByteLenInput) {
|
|
10
|
+
export function deserialize(buffer, sourceTextInput, sourceByteLenInput, preserveParensInput) {
|
|
11
11
|
uint8 = buffer;
|
|
12
12
|
uint32 = buffer.uint32;
|
|
13
13
|
float64 = buffer.float64;
|
|
@@ -15,6 +15,7 @@ export function deserialize(buffer, sourceTextInput, sourceByteLenInput) {
|
|
|
15
15
|
sourceText = sourceTextInput;
|
|
16
16
|
sourceByteLen = sourceByteLenInput;
|
|
17
17
|
sourceIsAscii = sourceText.length === sourceByteLen;
|
|
18
|
+
preserveParens = preserveParensInput;
|
|
18
19
|
|
|
19
20
|
const data = deserializeRawTransferData(uint32[536870902]);
|
|
20
21
|
|
|
@@ -488,12 +489,16 @@ function deserializeChainExpression(pos) {
|
|
|
488
489
|
}
|
|
489
490
|
|
|
490
491
|
function deserializeParenthesizedExpression(pos) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
492
|
+
let node = deserializeExpression(pos + 8);
|
|
493
|
+
if (preserveParens) {
|
|
494
|
+
node = {
|
|
495
|
+
type: 'ParenthesizedExpression',
|
|
496
|
+
expression: node,
|
|
497
|
+
start: deserializeU32(pos),
|
|
498
|
+
end: deserializeU32(pos + 4),
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
return node;
|
|
497
502
|
}
|
|
498
503
|
|
|
499
504
|
function deserializeDirective(pos) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxc-parser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"browser": "wasm.mjs",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "
|
|
8
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
9
9
|
},
|
|
10
10
|
"description": "Oxc Parser Node API",
|
|
11
11
|
"keywords": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@oxc-project/types": "^0.
|
|
53
|
+
"@oxc-project/types": "^0.90.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@codspeed/vitest-plugin": "^4.0.0",
|
|
@@ -90,21 +90,21 @@
|
|
|
90
90
|
"dtsHeaderFile": "header.js"
|
|
91
91
|
},
|
|
92
92
|
"optionalDependencies": {
|
|
93
|
-
"@oxc-parser/binding-win32-x64-msvc": "0.
|
|
94
|
-
"@oxc-parser/binding-win32-arm64-msvc": "0.
|
|
95
|
-
"@oxc-parser/binding-linux-x64-gnu": "0.
|
|
96
|
-
"@oxc-parser/binding-linux-x64-musl": "0.
|
|
97
|
-
"@oxc-parser/binding-freebsd-x64": "0.
|
|
98
|
-
"@oxc-parser/binding-linux-arm64-gnu": "0.
|
|
99
|
-
"@oxc-parser/binding-linux-arm64-musl": "0.
|
|
100
|
-
"@oxc-parser/binding-linux-arm-gnueabihf": "0.
|
|
101
|
-
"@oxc-parser/binding-linux-arm-musleabihf": "0.
|
|
102
|
-
"@oxc-parser/binding-linux-s390x-gnu": "0.
|
|
103
|
-
"@oxc-parser/binding-linux-riscv64-gnu": "0.
|
|
104
|
-
"@oxc-parser/binding-darwin-x64": "0.
|
|
105
|
-
"@oxc-parser/binding-darwin-arm64": "0.
|
|
106
|
-
"@oxc-parser/binding-android-arm64": "0.
|
|
107
|
-
"@oxc-parser/binding-wasm32-wasi": "0.
|
|
93
|
+
"@oxc-parser/binding-win32-x64-msvc": "0.90.0",
|
|
94
|
+
"@oxc-parser/binding-win32-arm64-msvc": "0.90.0",
|
|
95
|
+
"@oxc-parser/binding-linux-x64-gnu": "0.90.0",
|
|
96
|
+
"@oxc-parser/binding-linux-x64-musl": "0.90.0",
|
|
97
|
+
"@oxc-parser/binding-freebsd-x64": "0.90.0",
|
|
98
|
+
"@oxc-parser/binding-linux-arm64-gnu": "0.90.0",
|
|
99
|
+
"@oxc-parser/binding-linux-arm64-musl": "0.90.0",
|
|
100
|
+
"@oxc-parser/binding-linux-arm-gnueabihf": "0.90.0",
|
|
101
|
+
"@oxc-parser/binding-linux-arm-musleabihf": "0.90.0",
|
|
102
|
+
"@oxc-parser/binding-linux-s390x-gnu": "0.90.0",
|
|
103
|
+
"@oxc-parser/binding-linux-riscv64-gnu": "0.90.0",
|
|
104
|
+
"@oxc-parser/binding-darwin-x64": "0.90.0",
|
|
105
|
+
"@oxc-parser/binding-darwin-arm64": "0.90.0",
|
|
106
|
+
"@oxc-parser/binding-android-arm64": "0.90.0",
|
|
107
|
+
"@oxc-parser/binding-wasm32-wasi": "0.90.0"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
110
|
"build-dev": "napi build --esm --platform --js bindings.mjs",
|
package/raw-transfer/common.mjs
CHANGED
|
@@ -7,8 +7,6 @@ import {
|
|
|
7
7
|
import { BUFFER_ALIGN, BUFFER_SIZE, IS_TS_FLAG_POS } from '../generated/constants.mjs';
|
|
8
8
|
import { rawTransferSupported } from './supported.mjs';
|
|
9
9
|
|
|
10
|
-
export { isJsAst, parseAsyncRawImpl, parseSyncRawImpl, prepareRaw, returnBufferToCache };
|
|
11
|
-
|
|
12
10
|
// Throw an error if running on a platform which raw transfer doesn't support.
|
|
13
11
|
//
|
|
14
12
|
// Note: This module is lazy-loaded only when user calls `parseSync` or `parseAsync` with
|
|
@@ -34,7 +32,7 @@ if (!rawTransferSupported()) {
|
|
|
34
32
|
* @param {function} convert - Function to convert the buffer returned from Rust into a JS object
|
|
35
33
|
* @returns {Object} - The return value of `convert`
|
|
36
34
|
*/
|
|
37
|
-
function parseSyncRawImpl(filename, sourceText, options, convert) {
|
|
35
|
+
export function parseSyncRawImpl(filename, sourceText, options, convert) {
|
|
38
36
|
const { buffer, sourceByteLen } = prepareRaw(sourceText);
|
|
39
37
|
parseSyncRawBinding(filename, buffer, sourceByteLen, options);
|
|
40
38
|
return convert(buffer, sourceText, sourceByteLen);
|
|
@@ -93,7 +91,7 @@ const queue = [];
|
|
|
93
91
|
* @param {function} convert - Function to convert the buffer returned from Rust into a JS object
|
|
94
92
|
* @returns {Object} - The return value of `convert`
|
|
95
93
|
*/
|
|
96
|
-
async function parseAsyncRawImpl(filename, sourceText, options, convert) {
|
|
94
|
+
export async function parseAsyncRawImpl(filename, sourceText, options, convert) {
|
|
97
95
|
// Wait for a free CPU core if all CPUs are currently busy.
|
|
98
96
|
//
|
|
99
97
|
// Note: `availableCores` is NOT decremented if have to wait in the queue first,
|
|
@@ -180,7 +178,7 @@ const textEncoder = new TextEncoder();
|
|
|
180
178
|
* - `sourceByteLen`: Length of source text in UTF-8 bytes
|
|
181
179
|
* (which may not be equal to `sourceText.length` if source contains non-ASCII characters).
|
|
182
180
|
*/
|
|
183
|
-
function prepareRaw(sourceText) {
|
|
181
|
+
export function prepareRaw(sourceText) {
|
|
184
182
|
// Cancel timeout for clearing buffers
|
|
185
183
|
if (clearBuffersTimeout !== null) {
|
|
186
184
|
clearTimeout(clearBuffersTimeout);
|
|
@@ -218,7 +216,7 @@ function prepareRaw(sourceText) {
|
|
|
218
216
|
* @param {Uint8Array} buffer - Buffer containing AST in raw form
|
|
219
217
|
* @returns {boolean} - `true` if AST is JS, `false` if TS
|
|
220
218
|
*/
|
|
221
|
-
function isJsAst(buffer) {
|
|
219
|
+
export function isJsAst(buffer) {
|
|
222
220
|
return buffer[IS_TS_FLAG_POS] === 0;
|
|
223
221
|
}
|
|
224
222
|
|
|
@@ -229,7 +227,7 @@ function isJsAst(buffer) {
|
|
|
229
227
|
* @param {Uint8Array} buffer - Buffer
|
|
230
228
|
* @returns {undefined}
|
|
231
229
|
*/
|
|
232
|
-
function returnBufferToCache(buffer) {
|
|
230
|
+
export function returnBufferToCache(buffer) {
|
|
233
231
|
buffers.push(buffer);
|
|
234
232
|
|
|
235
233
|
if (clearBuffersTimeout !== null) clearTimeout(clearBuffersTimeout);
|
package/raw-transfer/eager.mjs
CHANGED
|
@@ -56,7 +56,10 @@ function deserialize(buffer, sourceText, sourceByteLen) {
|
|
|
56
56
|
let data;
|
|
57
57
|
if (isJsAst(buffer)) {
|
|
58
58
|
if (deserializeJS === null) deserializeJS = require('../generated/deserialize/js.mjs').deserialize;
|
|
59
|
-
|
|
59
|
+
|
|
60
|
+
// `preserveParens` argument is unconditionally `true` here. If `options` contains `preserveParens: false`,
|
|
61
|
+
// `ParenthesizedExpression` nodes won't be in AST anyway, so the value is irrelevant.
|
|
62
|
+
data = deserializeJS(buffer, sourceText, sourceByteLen, true);
|
|
60
63
|
|
|
61
64
|
// Add a line comment for hashbang
|
|
62
65
|
const { hashbang } = data.program;
|
|
@@ -65,7 +68,11 @@ function deserialize(buffer, sourceText, sourceByteLen) {
|
|
|
65
68
|
}
|
|
66
69
|
} else {
|
|
67
70
|
if (deserializeTS === null) deserializeTS = require('../generated/deserialize/ts.mjs').deserialize;
|
|
68
|
-
|
|
71
|
+
|
|
72
|
+
// `preserveParens` argument is unconditionally `true` here. If `options` contains `preserveParens: false`,
|
|
73
|
+
// `ParenthesizedExpression` nodes won't be in AST anyway, so the value is irrelevant.
|
|
74
|
+
data = deserializeTS(buffer, sourceText, sourceByteLen, true);
|
|
75
|
+
|
|
69
76
|
// Note: Do not add line comment for hashbang, to match `@typescript-eslint/parser`.
|
|
70
77
|
// See https://github.com/oxc-project/oxc/blob/ea784f5f082e4c53c98afde9bf983afd0b95e44e/napi/parser/src/lib.rs#L106-L130
|
|
71
78
|
}
|