From 7e42e71f34a11b78b3a8c243e741ce566f53ffad Mon Sep 17 00:00:00 2001 From: Boshen Date: Sat, 30 Nov 2024 10:47:03 +0800 Subject: [PATCH] deps: bump wasm-bindgen to 0.2.96 (#7551) --- .github/workflows/ci.yml | 4 +- Cargo.lock | 24 +- Cargo.toml | 2 +- npm/oxc-wasm/oxc_wasm.d.ts | 73 +++--- npm/oxc-wasm/oxc_wasm.js | 378 ++++++++++++----------------- npm/oxc-wasm/oxc_wasm_bg.wasm.d.ts | 46 ++-- 6 files changed, 226 insertions(+), 301 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a71dfc25a2046..cd30260b2cea3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,9 +135,7 @@ jobs: - run: just build-wasm debug - working-directory: npm/oxc-wasm - run: | - sed -i ${{ (runner.os == 'macOS' && '""') || '' }} -e 's/=> Array;/=> number[];/g' oxc_wasm.d.ts - pnpm run check + run: pnpm run check - working-directory: wasm/parser run: pnpm run build diff --git a/Cargo.lock b/Cargo.lock index 3d7f21695e83a..35810be9bca9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1078,7 +1078,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -3257,9 +3257,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "21d3b25c3ea1126a2ad5f4f9068483c2af1e64168f847abe863a526b8dbfe00b" dependencies = [ "cfg-if", "once_cell", @@ -3268,9 +3268,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "52857d4c32e496dc6537646b5b117081e71fd2ff06de792e3577a150627db283" dependencies = [ "bumpalo", "log", @@ -3283,9 +3283,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "920b0ffe069571ebbfc9ddc0b36ba305ef65577c94b06262ed793716a1afd981" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3293,9 +3293,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "bf59002391099644be3524e23b781fa43d2be0c5aa0719a18c0731b9d195cab6" dependencies = [ "proc-macro2", "quote", @@ -3306,9 +3306,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "e5047c5392700766601942795a436d7d2599af60dcc3cc1248c9120bfb0827b0" [[package]] name = "web-sys" @@ -3372,7 +3372,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0994c42410f1d..b21864bd8017d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -196,7 +196,7 @@ tsify = "0.4.5" ureq = { version = "2.10.1", default-features = false } url = "2.5.2" walkdir = "2.5.0" -wasm-bindgen = "0.2.95" +wasm-bindgen = "0.2.96" [workspace.metadata.cargo-shear] ignored = ["napi", "oxc_transform_napi", "prettyplease"] diff --git a/npm/oxc-wasm/oxc_wasm.d.ts b/npm/oxc-wasm/oxc_wasm.d.ts index 90fb5fceef807..9922a877dc1ff 100644 --- a/npm/oxc-wasm/oxc_wasm.d.ts +++ b/npm/oxc-wasm/oxc_wasm.d.ts @@ -1,10 +1,5 @@ /* tslint:disable */ /* eslint-disable */ -/** - * @param {string} query - * @param {any} opts - * @returns {any} - */ export function browserslist(query: string, opts: any): any; export interface OxcOptions { run?: OxcRunOptions; @@ -93,12 +88,6 @@ export interface Comment { export type CommentType = "Line" | "Block"; -export interface Reference { - nodeId: NodeId; - symbolId: SymbolId | null; - flags: ReferenceFlags; -} - export type IndexVec = Array; export type CompactStr = string; @@ -116,11 +105,11 @@ export interface SymbolTable { references: IndexVec; } - -export type SymbolId = number; -export type SymbolFlags = unknown; -export type RedeclarationId = unknown; - +export interface Reference { + nodeId: NodeId; + symbolId: SymbolId | null; + flags: ReferenceFlags; +} export type NodeId = number; @@ -133,10 +122,6 @@ export type NodeFlags = { -export type ScopeId = number; - - - export type ReferenceId = number; export type ReferenceFlags = { None: 0, @@ -147,6 +132,16 @@ export type ReferenceFlags = { } + +export type ScopeId = number; + + + +export type SymbolId = number; +export type SymbolFlags = unknown; +export type RedeclarationId = unknown; + + export class Oxc { free(): void; constructor(); @@ -154,20 +149,16 @@ export class Oxc { * Returns Array of String * # Errors * # Panics - * @returns {any[]} */ getDiagnostics(): any[]; /** * Returns comments * # Errors - * @returns {any[]} */ getComments(): any[]; /** * # Errors * Serde serialization error - * @param {string} source_text - * @param {OxcOptions} options */ run(source_text: string, options: OxcOptions): void; } @@ -177,28 +168,28 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl export interface InitOutput { readonly memory: WebAssembly.Memory; readonly __wbg_oxc_free: (a: number, b: number) => void; - readonly __wbg_get_oxc_ast: (a: number) => number; - readonly __wbg_get_oxc_ir: (a: number) => number[]; - readonly __wbg_get_oxc_controlFlowGraph: (a: number) => number[]; - readonly __wbg_get_oxc_symbols: (a: number) => number; - readonly __wbg_get_oxc_scopeText: (a: number) => number[]; - readonly __wbg_get_oxc_codegenText: (a: number) => number[]; - readonly __wbg_get_oxc_formattedText: (a: number) => number[]; - readonly __wbg_get_oxc_prettierFormattedText: (a: number) => number[]; - readonly __wbg_get_oxc_prettierIrText: (a: number) => number[]; + readonly __wbg_get_oxc_ast: (a: number) => any; + readonly __wbg_get_oxc_ir: (a: number) => [number, number]; + readonly __wbg_get_oxc_controlFlowGraph: (a: number) => [number, number]; + readonly __wbg_get_oxc_symbols: (a: number) => any; + readonly __wbg_get_oxc_scopeText: (a: number) => [number, number]; + readonly __wbg_get_oxc_codegenText: (a: number) => [number, number]; + readonly __wbg_get_oxc_formattedText: (a: number) => [number, number]; + readonly __wbg_get_oxc_prettierFormattedText: (a: number) => [number, number]; + readonly __wbg_get_oxc_prettierIrText: (a: number) => [number, number]; readonly oxc_new: () => number; - readonly oxc_getDiagnostics: (a: number) => number[]; - readonly oxc_getComments: (a: number) => number[]; - readonly oxc_run: (a: number, b: number, c: number, d: number) => number[]; - readonly browserslist: (a: number, b: number, c: number) => number[]; - readonly __wbindgen_malloc: (a: number, b: number) => number; - readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; + readonly oxc_getDiagnostics: (a: number) => [number, number, number, number]; + readonly oxc_getComments: (a: number) => [number, number, number, number]; + readonly oxc_run: (a: number, b: number, c: number, d: any) => [number, number]; + readonly browserslist: (a: number, b: number, c: any) => [number, number, number]; + readonly __wbindgen_exn_store: (a: number) => void; + readonly __externref_table_alloc: () => number; readonly __wbindgen_export_2: WebAssembly.Table; readonly __wbindgen_free: (a: number, b: number, c: number) => void; + readonly __wbindgen_malloc: (a: number, b: number) => number; + readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __externref_table_dealloc: (a: number) => void; readonly __externref_drop_slice: (a: number, b: number) => void; - readonly __wbindgen_exn_store: (a: number) => void; - readonly __externref_table_alloc: () => number; readonly __wbindgen_start: () => void; } diff --git a/npm/oxc-wasm/oxc_wasm.js b/npm/oxc-wasm/oxc_wasm.js index cd2706a30820f..47c93e69c0d03 100644 --- a/npm/oxc-wasm/oxc_wasm.js +++ b/npm/oxc-wasm/oxc_wasm.js @@ -1,5 +1,20 @@ let wasm; +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_2.set(idx, obj); + return idx; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; @@ -18,16 +33,6 @@ function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } -function _assertBoolean(n) { - if (typeof(n) !== 'boolean') { - throw new Error(`expected a boolean argument, found ${typeof(n)}`); - } -} - -function _assertNum(n) { - if (typeof(n) !== 'number') throw new Error(`expected a number argument, found ${typeof(n)}`); -} - let WASM_VECTOR_LEN = 0; const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); @@ -47,8 +52,6 @@ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' function passStringToWasm0(arg, malloc, realloc) { - if (typeof(arg) !== 'string') throw new Error(`expected a string argument, found ${typeof(arg)}`); - if (realloc === undefined) { const buf = cachedTextEncoder.encode(arg); const ptr = malloc(buf.length, 1) >>> 0; @@ -77,7 +80,7 @@ function passStringToWasm0(arg, malloc, realloc) { ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); const ret = encodeString(arg, view); - if (ret.read !== arg.length) throw new Error('failed to pass whole string'); + offset += ret.written; ptr = realloc(ptr, len, offset, 1) >>> 0; } @@ -86,10 +89,6 @@ function passStringToWasm0(arg, malloc, realloc) { return ptr; } -function isLikeNone(x) { - return x === undefined || x === null; -} - let cachedDataViewMemory0 = null; function getDataViewMemory0() { @@ -140,7 +139,7 @@ function debugString(val) { // Test for built-in const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); let className; - if (builtInMatches.length > 1) { + if (builtInMatches && builtInMatches.length > 1) { className = builtInMatches[1]; } else { // Failed to match the standard '[object ClassName]' @@ -164,6 +163,10 @@ function debugString(val) { return className; } +function isLikeNone(x) { + return x === undefined || x === null; +} + function takeFromExternrefTable0(idx) { const value = wasm.__wbindgen_export_2.get(idx); wasm.__externref_table_dealloc(idx); @@ -180,22 +183,6 @@ function getArrayJsValueFromWasm0(ptr, len) { wasm.__externref_drop_slice(ptr, len); return result; } - -function logError(f, args) { - try { - return f.apply(this, args); - } catch (e) { - let error = (function () { - try { - return e instanceof Error ? `${e.message}\n\nStack:\n${e.stack}` : e.toString(); - } catch(_) { - return ""; - } - }()); - console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error); - throw e; - } -} /** * @param {string} query * @param {any} opts @@ -211,21 +198,6 @@ export function browserslist(query, opts) { return takeFromExternrefTable0(ret[0]); } -function addToExternrefTable0(obj) { - const idx = wasm.__externref_table_alloc(); - wasm.__wbindgen_export_2.set(idx, obj); - return idx; -} - -function handleError(f, args) { - try { - return f.apply(this, args); - } catch (e) { - const idx = addToExternrefTable0(e); - wasm.__wbindgen_exn_store(idx); - } -} - const OxcFinalization = (typeof FinalizationRegistry === 'undefined') ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_oxc_free(ptr >>> 0, 1)); @@ -247,8 +219,6 @@ export class Oxc { * @returns {any} */ get ast() { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_ast(this.__wbg_ptr); return ret; } @@ -259,8 +229,6 @@ export class Oxc { let deferred1_0; let deferred1_1; try { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_ir(this.__wbg_ptr); deferred1_0 = ret[0]; deferred1_1 = ret[1]; @@ -276,8 +244,6 @@ export class Oxc { let deferred1_0; let deferred1_1; try { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_controlFlowGraph(this.__wbg_ptr); deferred1_0 = ret[0]; deferred1_1 = ret[1]; @@ -290,8 +256,6 @@ export class Oxc { * @returns {any} */ get symbols() { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_symbols(this.__wbg_ptr); return ret; } @@ -302,8 +266,6 @@ export class Oxc { let deferred1_0; let deferred1_1; try { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_scopeText(this.__wbg_ptr); deferred1_0 = ret[0]; deferred1_1 = ret[1]; @@ -319,8 +281,6 @@ export class Oxc { let deferred1_0; let deferred1_1; try { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_codegenText(this.__wbg_ptr); deferred1_0 = ret[0]; deferred1_1 = ret[1]; @@ -336,8 +296,6 @@ export class Oxc { let deferred1_0; let deferred1_1; try { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_formattedText(this.__wbg_ptr); deferred1_0 = ret[0]; deferred1_1 = ret[1]; @@ -353,8 +311,6 @@ export class Oxc { let deferred1_0; let deferred1_1; try { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_prettierFormattedText(this.__wbg_ptr); deferred1_0 = ret[0]; deferred1_1 = ret[1]; @@ -370,8 +326,6 @@ export class Oxc { let deferred1_0; let deferred1_1; try { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.__wbg_get_oxc_prettierIrText(this.__wbg_ptr); deferred1_0 = ret[0]; deferred1_1 = ret[1]; @@ -393,8 +347,6 @@ export class Oxc { * @returns {any[]} */ getDiagnostics() { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.oxc_getDiagnostics(this.__wbg_ptr); if (ret[3]) { throw takeFromExternrefTable0(ret[2]); @@ -409,8 +361,6 @@ export class Oxc { * @returns {any[]} */ getComments() { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ret = wasm.oxc_getComments(this.__wbg_ptr); if (ret[3]) { throw takeFromExternrefTable0(ret[2]); @@ -426,8 +376,6 @@ export class Oxc { * @param {OxcOptions} options */ run(source_text, options) { - if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value'); - _assertNum(this.__wbg_ptr); const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.oxc_run(this.__wbg_ptr, ptr0, len0, options); @@ -471,20 +419,15 @@ async function __wbg_load(module, imports) { function __wbg_get_imports() { const imports = {}; imports.wbg = {}; - imports.wbg.__wbindgen_error_new = function(arg0, arg1) { - const ret = new Error(getStringFromWasm0(arg0, arg1)); - return ret; - }; - imports.wbg.__wbindgen_is_undefined = function(arg0) { - const ret = arg0 === undefined; - _assertBoolean(ret); + imports.wbg.__wbg_buffer_71667b1101df19da = function(arg0) { + const ret = arg0.buffer; return ret; }; - imports.wbg.__wbindgen_as_number = function(arg0) { - const ret = +arg0; + imports.wbg.__wbg_call_d68488931693e6ee = function() { return handleError(function (arg0, arg1) { + const ret = arg0.call(arg1); return ret; - }; - imports.wbg.__wbg_error_f851667af71bcfc6 = function() { return logError(function (arg0, arg1) { + }, arguments) }; + imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) { let deferred0_0; let deferred0_1; try { @@ -494,84 +437,28 @@ function __wbg_get_imports() { } finally { wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); } - }, arguments) }; - imports.wbg.__wbg_new_abda76e883ba8a5f = function() { return logError(function () { - const ret = new Error(); - return ret; - }, arguments) }; - imports.wbg.__wbg_stack_658279fe44541cf6 = function() { return logError(function (arg0, arg1) { - const ret = arg1.stack; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }, arguments) }; - imports.wbg.__wbindgen_in = function(arg0, arg1) { - const ret = arg0 in arg1; - _assertBoolean(ret); - return ret; - }; - imports.wbg.__wbindgen_boolean_get = function(arg0) { - const v = arg0; - const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; - _assertNum(ret); - return ret; - }; - imports.wbg.__wbindgen_string_new = function(arg0, arg1) { - const ret = getStringFromWasm0(arg0, arg1); - return ret; - }; - imports.wbg.__wbindgen_string_get = function(arg0, arg1) { - const obj = arg1; - const ret = typeof(obj) === 'string' ? obj : undefined; - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }; - imports.wbg.__wbindgen_is_object = function(arg0) { - const val = arg0; - const ret = typeof(val) === 'object' && val !== null; - _assertBoolean(ret); - return ret; - }; - imports.wbg.__wbindgen_number_get = function(arg0, arg1) { - const obj = arg1; - const ret = typeof(obj) === 'number' ? obj : undefined; - if (!isLikeNone(ret)) { - _assertNum(ret); - } - getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); }; - imports.wbg.__wbindgen_number_new = function(arg0) { - const ret = arg0; + imports.wbg.__wbg_getTime_55e0fe6b64674dc4 = function(arg0) { + const ret = arg0.getTime(); return ret; }; - imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) { - const ret = arg0 == arg1; - _assertBoolean(ret); + imports.wbg.__wbg_get_ddd82e34e6366fb9 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(arg0, arg1); return ret; - }; - imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) { - const ret = BigInt.asUintN(64, arg0); + }, arguments) }; + imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) { + const ret = arg0[arg1]; return ret; }; - imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function() { return logError(function (arg0, arg1) { - const ret = arg0[arg1]; + imports.wbg.__wbg_globalThis_59c7794d9413986f = function() { return handleError(function () { + const ret = globalThis.globalThis; return ret; }, arguments) }; - imports.wbg.__wbg_set_f975102236d3c502 = function() { return logError(function (arg0, arg1, arg2) { - arg0[arg1] = arg2; - }, arguments) }; - imports.wbg.__wbg_new_034f913e7636e987 = function() { return logError(function () { - const ret = new Array(); + imports.wbg.__wbg_global_04c81bad83a72129 = function() { return handleError(function () { + const ret = global.global; return ret; }, arguments) }; - imports.wbg.__wbg_set_425e70f7c64ac962 = function() { return logError(function (arg0, arg1, arg2) { - arg0[arg1 >>> 0] = arg2; - }, arguments) }; - imports.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function() { return logError(function (arg0) { + imports.wbg.__wbg_instanceof_ArrayBuffer_36214dbc6ea8dd3d = function(arg0) { let result; try { result = arg0 instanceof ArrayBuffer; @@ -579,93 +466,95 @@ function __wbg_get_imports() { result = false; } const ret = result; - _assertBoolean(ret); - return ret; - }, arguments) }; - imports.wbg.__wbg_newnoargs_1ede4bf2ebbaaf43 = function() { return logError(function (arg0, arg1) { - const ret = new Function(getStringFromWasm0(arg0, arg1)); return ret; - }, arguments) }; - imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) { - const ret = arg0.call(arg1); - return ret; - }, arguments) }; - imports.wbg.__wbg_new_7a87a0376e40533b = function() { return logError(function () { - const ret = new Map(); - return ret; - }, arguments) }; - imports.wbg.__wbg_set_277a63e77c89279f = function() { return logError(function (arg0, arg1, arg2) { - const ret = arg0.set(arg1, arg2); + }; + imports.wbg.__wbg_instanceof_Uint8Array_0d898f7981fe0a2d = function(arg0) { + let result; + try { + result = arg0 instanceof Uint8Array; + } catch (_) { + result = false; + } + const ret = result; return ret; - }, arguments) }; - imports.wbg.__wbg_getTime_41225036a0393d63 = function() { return logError(function (arg0) { - const ret = arg0.getTime(); + }; + imports.wbg.__wbg_length_b52c3d528b88468e = function(arg0) { + const ret = arg0.length; return ret; - }, arguments) }; - imports.wbg.__wbg_new0_218ada33b570be35 = function() { return logError(function () { + }; + imports.wbg.__wbg_new0_9e4a93c1026c7bae = function() { const ret = new Date(); return ret; - }, arguments) }; - imports.wbg.__wbg_new_e69b5f66fda8f13c = function() { return logError(function () { - const ret = new Object(); + }; + imports.wbg.__wbg_new_8a6f238a6ece86ea = function() { + const ret = new Error(); return ret; - }, arguments) }; - imports.wbg.__wbg_globalThis_05c129bf37fcf1be = function() { return handleError(function () { - const ret = globalThis.globalThis; + }; + imports.wbg.__wbg_new_9e6542cc3fe4b09e = function() { + const ret = new Array(); return ret; - }, arguments) }; - imports.wbg.__wbg_self_bf91bf94d9e04084 = function() { return handleError(function () { - const ret = self.self; + }; + imports.wbg.__wbg_new_9ed4506807911440 = function(arg0) { + const ret = new Uint8Array(arg0); return ret; - }, arguments) }; - imports.wbg.__wbg_window_52dd9f07d03fd5f8 = function() { return handleError(function () { - const ret = window.window; + }; + imports.wbg.__wbg_new_dbb4955149975b18 = function() { + const ret = new Object(); return ret; - }, arguments) }; - imports.wbg.__wbg_global_3eca19bb09e9c484 = function() { return handleError(function () { - const ret = global.global; + }; + imports.wbg.__wbg_new_efea5718d1896ea2 = function() { + const ret = new Map(); return ret; - }, arguments) }; - imports.wbg.__wbg_instanceof_Uint8Array_df0761410414ef36 = function() { return logError(function (arg0) { - let result; - try { - result = arg0 instanceof Uint8Array; - } catch (_) { - result = false; - } - const ret = result; - _assertBoolean(ret); + }; + imports.wbg.__wbg_newnoargs_fe7e106c48aadd7e = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); return ret; - }, arguments) }; - imports.wbg.__wbg_new_fec2611eb9180f95 = function() { return logError(function (arg0) { - const ret = new Uint8Array(arg0); + }; + imports.wbg.__wbg_self_c9a63b952bd22cbd = function() { return handleError(function () { + const ret = self.self; return ret; }, arguments) }; - imports.wbg.__wbg_length_9254c4bd3b9f23c4 = function() { return logError(function (arg0) { - const ret = arg0.length; - _assertNum(ret); + imports.wbg.__wbg_set_0ccc5fa791d83f2d = function(arg0, arg1, arg2) { + arg0[arg1 >>> 0] = arg2; + }; + imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) { + arg0[arg1] = arg2; + }; + imports.wbg.__wbg_set_9b8ce78fa3e7ad0e = function(arg0, arg1, arg2) { + const ret = arg0.set(arg1, arg2); return ret; - }, arguments) }; - imports.wbg.__wbg_set_ec2fcf81bc573fd9 = function() { return logError(function (arg0, arg1, arg2) { + }; + imports.wbg.__wbg_set_e8d9380e866a1e41 = function(arg0, arg1, arg2) { arg0.set(arg1, arg2 >>> 0); - }, arguments) }; - imports.wbg.__wbindgen_is_string = function(arg0) { - const ret = typeof(arg0) === 'string'; - _assertBoolean(ret); - return ret; }; - imports.wbg.__wbg_stringify_eead5648c09faaf8 = function() { return handleError(function (arg0) { + imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_stringify_af61cb825a8f0ce6 = function() { return handleError(function (arg0) { const ret = JSON.stringify(arg0); return ret; }, arguments) }; - imports.wbg.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) { - const ret = Reflect.get(arg0, arg1); + imports.wbg.__wbg_window_81304a10d2638125 = function() { return handleError(function () { + const ret = window.window; return ret; }, arguments) }; - imports.wbg.__wbg_buffer_ccaed51a635d8a2d = function() { return logError(function (arg0) { - const ret = arg0.buffer; + imports.wbg.__wbindgen_as_number = function(arg0) { + const ret = +arg0; return ret; - }, arguments) }; + }; + imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) { + const ret = BigInt.asUintN(64, arg0); + return ret; + }; + imports.wbg.__wbindgen_boolean_get = function(arg0) { + const v = arg0; + const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; + return ret; + }; imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { const ret = debugString(arg1); const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); @@ -673,11 +562,12 @@ function __wbg_get_imports() { getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbindgen_throw = function(arg0, arg1) { - throw new Error(getStringFromWasm0(arg0, arg1)); + imports.wbg.__wbindgen_error_new = function(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return ret; }; - imports.wbg.__wbindgen_memory = function() { - const ret = wasm.memory; + imports.wbg.__wbindgen_in = function(arg0, arg1) { + const ret = arg0 in arg1; return ret; }; imports.wbg.__wbindgen_init_externref_table = function() { @@ -690,6 +580,52 @@ function __wbg_get_imports() { table.set(offset + 3, false); ; }; + imports.wbg.__wbindgen_is_object = function(arg0) { + const val = arg0; + const ret = typeof(val) === 'object' && val !== null; + return ret; + }; + imports.wbg.__wbindgen_is_string = function(arg0) { + const ret = typeof(arg0) === 'string'; + return ret; + }; + imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = arg0 === undefined; + return ret; + }; + imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) { + const ret = arg0 == arg1; + return ret; + }; + imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; + return ret; + }; + imports.wbg.__wbindgen_number_get = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'number' ? obj : undefined; + getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); + }; + imports.wbg.__wbindgen_number_new = function(arg0) { + const ret = arg0; + return ret; + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; return imports; } diff --git a/npm/oxc-wasm/oxc_wasm_bg.wasm.d.ts b/npm/oxc-wasm/oxc_wasm_bg.wasm.d.ts index ba336bc45dbbd..e123cfaa2cfe1 100644 --- a/npm/oxc-wasm/oxc_wasm_bg.wasm.d.ts +++ b/npm/oxc-wasm/oxc_wasm_bg.wasm.d.ts @@ -1,27 +1,27 @@ /* tslint:disable */ /* eslint-disable */ export const memory: WebAssembly.Memory; -export function __wbg_oxc_free(a: number, b: number): void; -export function __wbg_get_oxc_ast(a: number): number; -export function __wbg_get_oxc_ir(a: number): Array; -export function __wbg_get_oxc_controlFlowGraph(a: number): Array; -export function __wbg_get_oxc_symbols(a: number): number; -export function __wbg_get_oxc_scopeText(a: number): Array; -export function __wbg_get_oxc_codegenText(a: number): Array; -export function __wbg_get_oxc_formattedText(a: number): Array; -export function __wbg_get_oxc_prettierFormattedText(a: number): Array; -export function __wbg_get_oxc_prettierIrText(a: number): Array; -export function oxc_new(): number; -export function oxc_getDiagnostics(a: number): Array; -export function oxc_getComments(a: number): Array; -export function oxc_run(a: number, b: number, c: number, d: number): Array; -export function browserslist(a: number, b: number, c: number): Array; -export function __wbindgen_malloc(a: number, b: number): number; -export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; +export const __wbg_oxc_free: (a: number, b: number) => void; +export const __wbg_get_oxc_ast: (a: number) => any; +export const __wbg_get_oxc_ir: (a: number) => [number, number]; +export const __wbg_get_oxc_controlFlowGraph: (a: number) => [number, number]; +export const __wbg_get_oxc_symbols: (a: number) => any; +export const __wbg_get_oxc_scopeText: (a: number) => [number, number]; +export const __wbg_get_oxc_codegenText: (a: number) => [number, number]; +export const __wbg_get_oxc_formattedText: (a: number) => [number, number]; +export const __wbg_get_oxc_prettierFormattedText: (a: number) => [number, number]; +export const __wbg_get_oxc_prettierIrText: (a: number) => [number, number]; +export const oxc_new: () => number; +export const oxc_getDiagnostics: (a: number) => [number, number, number, number]; +export const oxc_getComments: (a: number) => [number, number, number, number]; +export const oxc_run: (a: number, b: number, c: number, d: any) => [number, number]; +export const browserslist: (a: number, b: number, c: any) => [number, number, number]; +export const __wbindgen_exn_store: (a: number) => void; +export const __externref_table_alloc: () => number; export const __wbindgen_export_2: WebAssembly.Table; -export function __wbindgen_free(a: number, b: number, c: number): void; -export function __externref_table_dealloc(a: number): void; -export function __externref_drop_slice(a: number, b: number): void; -export function __wbindgen_exn_store(a: number): void; -export function __externref_table_alloc(): number; -export function __wbindgen_start(): void; +export const __wbindgen_free: (a: number, b: number, c: number) => void; +export const __wbindgen_malloc: (a: number, b: number) => number; +export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; +export const __externref_table_dealloc: (a: number) => void; +export const __externref_drop_slice: (a: number, b: number) => void; +export const __wbindgen_start: () => void;