@next/swc-wasm-web 12.1.7-canary.9 → 12.2.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/package.json +1 -1
- package/wasm.d.ts +4 -3
- package/wasm.js +62 -32
- package/wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/wasm.d.ts
CHANGED
|
@@ -23,12 +23,13 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
23
23
|
|
|
24
24
|
export interface InitOutput {
|
|
25
25
|
readonly memory: WebAssembly.Memory;
|
|
26
|
-
readonly minifySync: (a: number, b: number, c: number) =>
|
|
27
|
-
readonly transformSync: (a: number, b: number, c: number) =>
|
|
28
|
-
readonly parseSync: (a: number, b: number, c: number) =>
|
|
26
|
+
readonly minifySync: (a: number, b: number, c: number, d: number) => void;
|
|
27
|
+
readonly transformSync: (a: number, b: number, c: number, d: number) => void;
|
|
28
|
+
readonly parseSync: (a: number, b: number, c: number, d: number) => void;
|
|
29
29
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
30
30
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
31
31
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
32
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
/**
|
package/wasm.js
CHANGED
|
@@ -21,7 +21,7 @@ function takeObject(idx) {
|
|
|
21
21
|
return ret;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
25
25
|
|
|
26
26
|
cachedTextDecoder.decode();
|
|
27
27
|
|
|
@@ -48,7 +48,7 @@ function addHeapObject(obj) {
|
|
|
48
48
|
|
|
49
49
|
let WASM_VECTOR_LEN = 0;
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
const cachedTextEncoder = new TextEncoder('utf-8');
|
|
52
52
|
|
|
53
53
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
54
54
|
? function (arg, view) {
|
|
@@ -114,10 +114,21 @@ function getInt32Memory0() {
|
|
|
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
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
120
|
+
const 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 transformSync(s, opts) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
140
|
+
try {
|
|
141
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
142
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
143
|
+
const len0 = WASM_VECTOR_LEN;
|
|
144
|
+
wasm.transformSync(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,10 +160,21 @@ export function transformSync(s, opts) {
|
|
|
138
160
|
* @returns {any}
|
|
139
161
|
*/
|
|
140
162
|
export function parseSync(s, opts) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
163
|
+
try {
|
|
164
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
165
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
166
|
+
const len0 = WASM_VECTOR_LEN;
|
|
167
|
+
wasm.parseSync(retptr, ptr0, len0, addHeapObject(opts));
|
|
168
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
169
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
170
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
171
|
+
if (r2) {
|
|
172
|
+
throw takeObject(r1);
|
|
173
|
+
}
|
|
174
|
+
return takeObject(r0);
|
|
175
|
+
} finally {
|
|
176
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
177
|
+
}
|
|
145
178
|
}
|
|
146
179
|
|
|
147
180
|
async function load(module, imports) {
|
|
@@ -181,29 +214,29 @@ async function init(input) {
|
|
|
181
214
|
}
|
|
182
215
|
const imports = {};
|
|
183
216
|
imports.wbg = {};
|
|
184
|
-
imports.wbg.
|
|
185
|
-
|
|
217
|
+
imports.wbg.__wbg_new0_0ff7eb5c1486f3ec = function() {
|
|
218
|
+
const ret = new Date();
|
|
186
219
|
return addHeapObject(ret);
|
|
187
220
|
};
|
|
188
|
-
imports.wbg.
|
|
189
|
-
|
|
221
|
+
imports.wbg.__wbg_getTime_bffb1c09df09618b = function(arg0) {
|
|
222
|
+
const ret = getObject(arg0).getTime();
|
|
190
223
|
return ret;
|
|
191
224
|
};
|
|
192
225
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
193
226
|
takeObject(arg0);
|
|
194
227
|
};
|
|
195
|
-
imports.wbg.
|
|
196
|
-
|
|
228
|
+
imports.wbg.__wbg_getTimezoneOffset_9c9a2f880882a1d7 = function(arg0) {
|
|
229
|
+
const ret = getObject(arg0).getTimezoneOffset();
|
|
197
230
|
return ret;
|
|
198
231
|
};
|
|
199
232
|
imports.wbg.__wbg_new_693216e109162396 = function() {
|
|
200
|
-
|
|
233
|
+
const ret = new Error();
|
|
201
234
|
return addHeapObject(ret);
|
|
202
235
|
};
|
|
203
236
|
imports.wbg.__wbg_stack_0ddaca5d1abfb52f = function(arg0, arg1) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
237
|
+
const ret = getObject(arg1).stack;
|
|
238
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
239
|
+
const len0 = WASM_VECTOR_LEN;
|
|
207
240
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
208
241
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
209
242
|
};
|
|
@@ -215,27 +248,24 @@ async function init(input) {
|
|
|
215
248
|
}
|
|
216
249
|
};
|
|
217
250
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
218
|
-
|
|
251
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
219
252
|
return addHeapObject(ret);
|
|
220
253
|
};
|
|
221
254
|
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
222
255
|
const obj = getObject(arg1);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
256
|
+
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
257
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
258
|
+
const len0 = WASM_VECTOR_LEN;
|
|
226
259
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
227
260
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
228
261
|
};
|
|
229
262
|
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
|
|
230
|
-
|
|
263
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
231
264
|
return addHeapObject(ret);
|
|
232
265
|
};
|
|
233
266
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
234
267
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
235
268
|
};
|
|
236
|
-
imports.wbg.__wbindgen_rethrow = function(arg0) {
|
|
237
|
-
throw takeObject(arg0);
|
|
238
|
-
};
|
|
239
269
|
|
|
240
270
|
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
241
271
|
input = fetch(input);
|
package/wasm_bg.wasm
CHANGED
|
Binary file
|