@swc/wasm 1.2.158 → 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 +8 -2
- package/wasm.js +63 -22
- package/wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/wasm.d.ts
CHANGED
|
@@ -18,9 +18,15 @@ 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
|
+
|
package/wasm.js
CHANGED
|
@@ -116,10 +116,21 @@ function takeObject(idx) {
|
|
|
116
116
|
* @returns {any}
|
|
117
117
|
*/
|
|
118
118
|
module.exports.minifySync = function(s, opts) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
try {
|
|
120
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
121
|
+
var ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
122
|
+
var len0 = WASM_VECTOR_LEN;
|
|
123
|
+
wasm.minifySync(retptr, ptr0, len0, addHeapObject(opts));
|
|
124
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
125
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
126
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
127
|
+
if (r2) {
|
|
128
|
+
throw takeObject(r1);
|
|
129
|
+
}
|
|
130
|
+
return takeObject(r0);
|
|
131
|
+
} finally {
|
|
132
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
133
|
+
}
|
|
123
134
|
};
|
|
124
135
|
|
|
125
136
|
/**
|
|
@@ -128,10 +139,21 @@ module.exports.minifySync = function(s, opts) {
|
|
|
128
139
|
* @returns {any}
|
|
129
140
|
*/
|
|
130
141
|
module.exports.parseSync = function(s, opts) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
142
|
+
try {
|
|
143
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
144
|
+
var ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
145
|
+
var len0 = WASM_VECTOR_LEN;
|
|
146
|
+
wasm.parseSync(retptr, ptr0, len0, addHeapObject(opts));
|
|
147
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
148
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
149
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
150
|
+
if (r2) {
|
|
151
|
+
throw takeObject(r1);
|
|
152
|
+
}
|
|
153
|
+
return takeObject(r0);
|
|
154
|
+
} finally {
|
|
155
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
156
|
+
}
|
|
135
157
|
};
|
|
136
158
|
|
|
137
159
|
/**
|
|
@@ -140,20 +162,43 @@ module.exports.parseSync = function(s, opts) {
|
|
|
140
162
|
* @returns {any}
|
|
141
163
|
*/
|
|
142
164
|
module.exports.printSync = function(s, opts) {
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
try {
|
|
166
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
167
|
+
wasm.printSync(retptr, addHeapObject(s), 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
|
/**
|
|
148
181
|
* @param {string} s
|
|
149
182
|
* @param {any} opts
|
|
183
|
+
* @param {any} experimental_plugin_bytes_resolver
|
|
150
184
|
* @returns {any}
|
|
151
185
|
*/
|
|
152
|
-
module.exports.transformSync = function(s, opts) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
186
|
+
module.exports.transformSync = function(s, opts, experimental_plugin_bytes_resolver) {
|
|
187
|
+
try {
|
|
188
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
189
|
+
var ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
190
|
+
var len0 = WASM_VECTOR_LEN;
|
|
191
|
+
wasm.transformSync(retptr, ptr0, len0, addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver));
|
|
192
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
193
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
194
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
195
|
+
if (r2) {
|
|
196
|
+
throw takeObject(r1);
|
|
197
|
+
}
|
|
198
|
+
return takeObject(r0);
|
|
199
|
+
} finally {
|
|
200
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
201
|
+
}
|
|
157
202
|
};
|
|
158
203
|
|
|
159
204
|
module.exports.__wbindgen_json_parse = function(arg0, arg1) {
|
|
@@ -179,17 +224,17 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
|
179
224
|
return addHeapObject(ret);
|
|
180
225
|
};
|
|
181
226
|
|
|
182
|
-
module.exports.
|
|
227
|
+
module.exports.__wbg_new0_57a6a2c2aaed3fc5 = function() {
|
|
183
228
|
var ret = new Date();
|
|
184
229
|
return addHeapObject(ret);
|
|
185
230
|
};
|
|
186
231
|
|
|
187
|
-
module.exports.
|
|
232
|
+
module.exports.__wbg_getTime_f8ce0ff902444efb = function(arg0) {
|
|
188
233
|
var ret = getObject(arg0).getTime();
|
|
189
234
|
return ret;
|
|
190
235
|
};
|
|
191
236
|
|
|
192
|
-
module.exports.
|
|
237
|
+
module.exports.__wbg_getTimezoneOffset_41211a984662508b = function(arg0) {
|
|
193
238
|
var ret = getObject(arg0).getTimezoneOffset();
|
|
194
239
|
return ret;
|
|
195
240
|
};
|
|
@@ -219,10 +264,6 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
|
219
264
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
220
265
|
};
|
|
221
266
|
|
|
222
|
-
module.exports.__wbindgen_rethrow = function(arg0) {
|
|
223
|
-
throw takeObject(arg0);
|
|
224
|
-
};
|
|
225
|
-
|
|
226
267
|
const path = require('path').join(__dirname, 'wasm_bg.wasm');
|
|
227
268
|
const bytes = require('fs').readFileSync(path);
|
|
228
269
|
|
package/wasm_bg.wasm
CHANGED
|
Binary file
|