@swc/wasm-web 1.2.160 → 1.2.161
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/package.json +1 -1
- package/wasm.d.ts +13 -6
- package/wasm.js +63 -21
- package/wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/wasm.d.ts
CHANGED
|
@@ -18,23 +18,30 @@ export function parseSync(s: string, opts: any): any;
|
|
|
18
18
|
* @returns {any}
|
|
19
19
|
*/
|
|
20
20
|
export function printSync(s: any, opts: any): any;
|
|
21
|
+
|
|
21
22
|
/**
|
|
22
|
-
* @param {string}
|
|
23
|
+
* @param {string} code
|
|
23
24
|
* @param {any} opts
|
|
25
|
+
* @param {Record<string, ArrayBuffer>} experimental_plugin_bytes_resolver An object contains bytes array for the plugin
|
|
26
|
+
* specified in config. Key of record represents the name of the plugin specified in config. Note this is an experimental
|
|
27
|
+
* interface, likely will change.
|
|
24
28
|
* @returns {any}
|
|
25
29
|
*/
|
|
26
|
-
export function transformSync(
|
|
30
|
+
export function transformSync(code: string, opts: any, experimental_plugin_bytes_resolver?: any): any;
|
|
31
|
+
|
|
32
|
+
|
|
27
33
|
|
|
28
34
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
29
35
|
|
|
30
36
|
export interface InitOutput {
|
|
31
37
|
readonly memory: WebAssembly.Memory;
|
|
32
|
-
readonly minifySync: (a: number, b: number, c: number) =>
|
|
33
|
-
readonly parseSync: (a: number, b: number, c: number) =>
|
|
34
|
-
readonly printSync: (a: number, b: number) =>
|
|
35
|
-
readonly transformSync: (a: number, b: number, c: number) =>
|
|
38
|
+
readonly minifySync: (a: number, b: number, c: number, d: number) => void;
|
|
39
|
+
readonly parseSync: (a: number, b: number, c: number, d: number) => void;
|
|
40
|
+
readonly printSync: (a: number, b: number, c: number) => void;
|
|
41
|
+
readonly transformSync: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
36
42
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
37
43
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
44
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
38
45
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
39
46
|
}
|
|
40
47
|
|
package/wasm.js
CHANGED
|
@@ -114,10 +114,21 @@ function takeObject(idx) {
|
|
|
114
114
|
* @returns {any}
|
|
115
115
|
*/
|
|
116
116
|
export function minifySync(s, opts) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
try {
|
|
118
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
119
|
+
var ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
120
|
+
var len0 = WASM_VECTOR_LEN;
|
|
121
|
+
wasm.minifySync(retptr, ptr0, len0, addHeapObject(opts));
|
|
122
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
123
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
124
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
125
|
+
if (r2) {
|
|
126
|
+
throw takeObject(r1);
|
|
127
|
+
}
|
|
128
|
+
return takeObject(r0);
|
|
129
|
+
} finally {
|
|
130
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
131
|
+
}
|
|
121
132
|
}
|
|
122
133
|
|
|
123
134
|
/**
|
|
@@ -126,10 +137,21 @@ export function minifySync(s, opts) {
|
|
|
126
137
|
* @returns {any}
|
|
127
138
|
*/
|
|
128
139
|
export function parseSync(s, opts) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
140
|
+
try {
|
|
141
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
142
|
+
var ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
143
|
+
var len0 = WASM_VECTOR_LEN;
|
|
144
|
+
wasm.parseSync(retptr, ptr0, len0, addHeapObject(opts));
|
|
145
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
146
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
147
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
148
|
+
if (r2) {
|
|
149
|
+
throw takeObject(r1);
|
|
150
|
+
}
|
|
151
|
+
return takeObject(r0);
|
|
152
|
+
} finally {
|
|
153
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
154
|
+
}
|
|
133
155
|
}
|
|
134
156
|
|
|
135
157
|
/**
|
|
@@ -138,20 +160,43 @@ export function parseSync(s, opts) {
|
|
|
138
160
|
* @returns {any}
|
|
139
161
|
*/
|
|
140
162
|
export function printSync(s, opts) {
|
|
141
|
-
|
|
142
|
-
|
|
163
|
+
try {
|
|
164
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
165
|
+
wasm.printSync(retptr, addHeapObject(s), addHeapObject(opts));
|
|
166
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
167
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
168
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
169
|
+
if (r2) {
|
|
170
|
+
throw takeObject(r1);
|
|
171
|
+
}
|
|
172
|
+
return takeObject(r0);
|
|
173
|
+
} finally {
|
|
174
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
175
|
+
}
|
|
143
176
|
}
|
|
144
177
|
|
|
145
178
|
/**
|
|
146
179
|
* @param {string} s
|
|
147
180
|
* @param {any} opts
|
|
181
|
+
* @param {any} experimental_plugin_bytes_resolver
|
|
148
182
|
* @returns {any}
|
|
149
183
|
*/
|
|
150
|
-
export function transformSync(s, opts) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
184
|
+
export function transformSync(s, opts, experimental_plugin_bytes_resolver) {
|
|
185
|
+
try {
|
|
186
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
187
|
+
var ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
|
+
var len0 = WASM_VECTOR_LEN;
|
|
189
|
+
wasm.transformSync(retptr, ptr0, len0, addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver));
|
|
190
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
191
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
192
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
193
|
+
if (r2) {
|
|
194
|
+
throw takeObject(r1);
|
|
195
|
+
}
|
|
196
|
+
return takeObject(r0);
|
|
197
|
+
} finally {
|
|
198
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
199
|
+
}
|
|
155
200
|
}
|
|
156
201
|
|
|
157
202
|
async function load(module, imports) {
|
|
@@ -210,15 +255,15 @@ async function init(input) {
|
|
|
210
255
|
var ret = getStringFromWasm0(arg0, arg1);
|
|
211
256
|
return addHeapObject(ret);
|
|
212
257
|
};
|
|
213
|
-
imports.wbg.
|
|
258
|
+
imports.wbg.__wbg_new0_57a6a2c2aaed3fc5 = function() {
|
|
214
259
|
var ret = new Date();
|
|
215
260
|
return addHeapObject(ret);
|
|
216
261
|
};
|
|
217
|
-
imports.wbg.
|
|
262
|
+
imports.wbg.__wbg_getTime_f8ce0ff902444efb = function(arg0) {
|
|
218
263
|
var ret = getObject(arg0).getTime();
|
|
219
264
|
return ret;
|
|
220
265
|
};
|
|
221
|
-
imports.wbg.
|
|
266
|
+
imports.wbg.__wbg_getTimezoneOffset_41211a984662508b = function(arg0) {
|
|
222
267
|
var ret = getObject(arg0).getTimezoneOffset();
|
|
223
268
|
return ret;
|
|
224
269
|
};
|
|
@@ -243,9 +288,6 @@ async function init(input) {
|
|
|
243
288
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
244
289
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
245
290
|
};
|
|
246
|
-
imports.wbg.__wbindgen_rethrow = function(arg0) {
|
|
247
|
-
throw takeObject(arg0);
|
|
248
|
-
};
|
|
249
291
|
|
|
250
292
|
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
251
293
|
input = fetch(input);
|
package/wasm_bg.wasm
CHANGED
|
Binary file
|