@swc/wasm 1.2.222 → 1.2.225

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/wasm.js +68 -68
  3. package/wasm_bg.wasm +0 -0
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "강동윤 <kdy1997.dev@gmail.com>"
5
5
  ],
6
6
  "description": "wasm module for swc",
7
- "version": "1.2.222",
7
+ "version": "1.2.225",
8
8
  "license": "Apache-2.0",
9
9
  "repository": {
10
10
  "type": "git",
package/wasm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
- const { TextDecoder, TextEncoder } = require(`util`);
4
+ const { TextEncoder, TextDecoder } = require(`util`);
5
5
 
6
6
  const heap = new Array(32).fill(undefined);
7
7
 
@@ -23,9 +23,7 @@ function takeObject(idx) {
23
23
  return ret;
24
24
  }
25
25
 
26
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
27
-
28
- cachedTextDecoder.decode();
26
+ let WASM_VECTOR_LEN = 0;
29
27
 
30
28
  let cachedUint8Memory0 = new Uint8Array();
31
29
 
@@ -36,21 +34,6 @@ function getUint8Memory0() {
36
34
  return cachedUint8Memory0;
37
35
  }
38
36
 
39
- function getStringFromWasm0(ptr, len) {
40
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
- }
42
-
43
- function addHeapObject(obj) {
44
- if (heap_next === heap.length) heap.push(heap.length + 1);
45
- const idx = heap_next;
46
- heap_next = heap[idx];
47
-
48
- heap[idx] = obj;
49
- return idx;
50
- }
51
-
52
- let WASM_VECTOR_LEN = 0;
53
-
54
37
  let cachedTextEncoder = new TextEncoder('utf-8');
55
38
 
56
39
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -117,6 +100,23 @@ function getInt32Memory0() {
117
100
  return cachedInt32Memory0;
118
101
  }
119
102
 
103
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
104
+
105
+ cachedTextDecoder.decode();
106
+
107
+ function getStringFromWasm0(ptr, len) {
108
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
109
+ }
110
+
111
+ function addHeapObject(obj) {
112
+ if (heap_next === heap.length) heap.push(heap.length + 1);
113
+ const idx = heap_next;
114
+ heap_next = heap[idx];
115
+
116
+ heap[idx] = obj;
117
+ return idx;
118
+ }
119
+
120
120
  function makeMutClosure(arg0, arg1, dtor, f) {
121
121
  const state = { a: arg0, b: arg1, cnt: 1, dtor };
122
122
  const real = (...args) => {
@@ -210,12 +210,13 @@ module.exports.parse = function(s, opts) {
210
210
  /**
211
211
  * @param {any} s
212
212
  * @param {any} opts
213
+ * @param {any} experimental_plugin_bytes_resolver
213
214
  * @returns {any}
214
215
  */
215
- module.exports.printSync = function(s, opts) {
216
+ module.exports.transformSync = function(s, opts, experimental_plugin_bytes_resolver) {
216
217
  try {
217
218
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
218
- wasm.printSync(retptr, addHeapObject(s), addHeapObject(opts));
219
+ wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver));
219
220
  var r0 = getInt32Memory0()[retptr / 4 + 0];
220
221
  var r1 = getInt32Memory0()[retptr / 4 + 1];
221
222
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -231,23 +232,23 @@ module.exports.printSync = function(s, opts) {
231
232
  /**
232
233
  * @param {any} s
233
234
  * @param {any} opts
235
+ * @param {any} experimental_plugin_bytes_resolver
234
236
  * @returns {Promise<any>}
235
237
  */
236
- module.exports.print = function(s, opts) {
237
- const ret = wasm.print(addHeapObject(s), addHeapObject(opts));
238
+ module.exports.transform = function(s, opts, experimental_plugin_bytes_resolver) {
239
+ const ret = wasm.transform(addHeapObject(s), addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver));
238
240
  return takeObject(ret);
239
241
  };
240
242
 
241
243
  /**
242
244
  * @param {any} s
243
245
  * @param {any} opts
244
- * @param {any} experimental_plugin_bytes_resolver
245
246
  * @returns {any}
246
247
  */
247
- module.exports.transformSync = function(s, opts, experimental_plugin_bytes_resolver) {
248
+ module.exports.printSync = function(s, opts) {
248
249
  try {
249
250
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
250
- wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver));
251
+ wasm.printSync(retptr, addHeapObject(s), addHeapObject(opts));
251
252
  var r0 = getInt32Memory0()[retptr / 4 + 0];
252
253
  var r1 = getInt32Memory0()[retptr / 4 + 1];
253
254
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -263,11 +264,10 @@ module.exports.transformSync = function(s, opts, experimental_plugin_bytes_resol
263
264
  /**
264
265
  * @param {any} s
265
266
  * @param {any} opts
266
- * @param {any} experimental_plugin_bytes_resolver
267
267
  * @returns {Promise<any>}
268
268
  */
269
- module.exports.transform = function(s, opts, experimental_plugin_bytes_resolver) {
270
- const ret = wasm.transform(addHeapObject(s), addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver));
269
+ module.exports.print = function(s, opts) {
270
+ const ret = wasm.print(addHeapObject(s), addHeapObject(opts));
271
271
  return takeObject(ret);
272
272
  };
273
273
 
@@ -294,40 +294,6 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
294
294
  takeObject(arg0);
295
295
  };
296
296
 
297
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
298
- const ret = getStringFromWasm0(arg0, arg1);
299
- return addHeapObject(ret);
300
- };
301
-
302
- module.exports.__wbg_new_52205195aa880fc2 = function(arg0, arg1) {
303
- try {
304
- var state0 = {a: arg0, b: arg1};
305
- var cb0 = (arg0, arg1) => {
306
- const a = state0.a;
307
- state0.a = 0;
308
- try {
309
- return __wbg_adapter_45(a, state0.b, arg0, arg1);
310
- } finally {
311
- state0.a = a;
312
- }
313
- };
314
- const ret = new Promise(cb0);
315
- return addHeapObject(ret);
316
- } finally {
317
- state0.a = state0.b = 0;
318
- }
319
- };
320
-
321
- module.exports.__wbindgen_is_null = function(arg0) {
322
- const ret = getObject(arg0) === null;
323
- return ret;
324
- };
325
-
326
- module.exports.__wbindgen_is_undefined = function(arg0) {
327
- const ret = getObject(arg0) === undefined;
328
- return ret;
329
- };
330
-
331
297
  module.exports.__wbindgen_is_string = function(arg0) {
332
298
  const ret = typeof(getObject(arg0)) === 'string';
333
299
  return ret;
@@ -342,10 +308,15 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
342
308
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
343
309
  };
344
310
 
345
- module.exports.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
346
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
347
- return addHeapObject(ret);
348
- }, arguments) };
311
+ module.exports.__wbindgen_is_null = function(arg0) {
312
+ const ret = getObject(arg0) === null;
313
+ return ret;
314
+ };
315
+
316
+ module.exports.__wbindgen_is_undefined = function(arg0) {
317
+ const ret = getObject(arg0) === undefined;
318
+ return ret;
319
+ };
349
320
 
350
321
  module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
351
322
  const obj = getObject(arg1);
@@ -361,6 +332,35 @@ module.exports.__wbindgen_json_parse = function(arg0, arg1) {
361
332
  return addHeapObject(ret);
362
333
  };
363
334
 
335
+ module.exports.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
336
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
337
+ return addHeapObject(ret);
338
+ }, arguments) };
339
+
340
+ module.exports.__wbg_new_52205195aa880fc2 = function(arg0, arg1) {
341
+ try {
342
+ var state0 = {a: arg0, b: arg1};
343
+ var cb0 = (arg0, arg1) => {
344
+ const a = state0.a;
345
+ state0.a = 0;
346
+ try {
347
+ return __wbg_adapter_45(a, state0.b, arg0, arg1);
348
+ } finally {
349
+ state0.a = a;
350
+ }
351
+ };
352
+ const ret = new Promise(cb0);
353
+ return addHeapObject(ret);
354
+ } finally {
355
+ state0.a = state0.b = 0;
356
+ }
357
+ };
358
+
359
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
360
+ const ret = getStringFromWasm0(arg0, arg1);
361
+ return addHeapObject(ret);
362
+ };
363
+
364
364
  module.exports.__wbg_new0_adda2d4bcb124f0a = function() {
365
365
  const ret = new Date();
366
366
  return addHeapObject(ret);
@@ -419,7 +419,7 @@ module.exports.__wbg_then_18da6e5453572fc8 = function(arg0, arg1) {
419
419
  return addHeapObject(ret);
420
420
  };
421
421
 
422
- module.exports.__wbindgen_closure_wrapper14169 = function(arg0, arg1, arg2) {
422
+ module.exports.__wbindgen_closure_wrapper14389 = function(arg0, arg1, arg2) {
423
423
  const ret = makeMutClosure(arg0, arg1, 154, __wbg_adapter_22);
424
424
  return addHeapObject(ret);
425
425
  };
package/wasm_bg.wasm CHANGED
Binary file