@next/swc-wasm-web 13.0.7-canary.3 → 13.0.7-canary.4

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 (4) hide show
  1. package/package.json +1 -1
  2. package/wasm.d.ts +10 -3
  3. package/wasm.js +156 -105
  4. package/wasm_bg.wasm +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-web",
3
- "version": "13.0.7-canary.3",
3
+ "version": "13.0.7-canary.4",
4
4
  "files": [
5
5
  "wasm_bg.wasm",
6
6
  "wasm.js",
package/wasm.d.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
+ * @param {string} query
5
+ * @param {any} opts
6
+ * @returns {any}
7
+ */
8
+ export function browserslist(query: string, opts: any): any;
9
+ /**
4
10
  * @param {string} s
5
11
  * @param {any} opts
6
12
  * @returns {any}
@@ -53,6 +59,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
53
59
 
54
60
  export interface InitOutput {
55
61
  readonly memory: WebAssembly.Memory;
62
+ readonly browserslist: (a: number, b: number, c: number, d: number) => void;
56
63
  readonly minifySync: (a: number, b: number, c: number) => void;
57
64
  readonly minify: (a: number, b: number) => number;
58
65
  readonly transformSync: (a: number, b: number, c: number) => void;
@@ -64,11 +71,11 @@ export interface InitOutput {
64
71
  readonly __wbindgen_malloc: (a: number) => number;
65
72
  readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
66
73
  readonly __wbindgen_export_2: WebAssembly.Table;
67
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h81bf879b15d5b595: (a: number, b: number, c: number) => void;
74
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hffe971d8143b7d78: (a: number, b: number, c: number) => void;
75
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
68
76
  readonly __wbindgen_free: (a: number, b: number) => void;
69
77
  readonly __wbindgen_exn_store: (a: number) => void;
70
- readonly wasm_bindgen__convert__closures__invoke2_mut__h9021529d13816b40: (a: number, b: number, c: number, d: number) => void;
71
- readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
78
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h9f8728620ba34c2e: (a: number, b: number, c: number, d: number) => void;
72
79
  }
73
80
 
74
81
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/wasm.js CHANGED
@@ -1,26 +1,29 @@
1
1
 
2
2
  let wasm;
3
3
 
4
- const heap = new Array(32).fill(undefined);
5
-
6
- heap.push(undefined, null, true, false);
4
+ const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
7
5
 
8
- function getObject(idx) { return heap[idx]; }
6
+ cachedTextDecoder.decode();
9
7
 
10
- let heap_next = heap.length;
8
+ let cachedUint8Memory0 = new Uint8Array();
11
9
 
12
- function dropObject(idx) {
13
- if (idx < 36) return;
14
- heap[idx] = heap_next;
15
- heap_next = idx;
10
+ function getUint8Memory0() {
11
+ if (cachedUint8Memory0.byteLength === 0) {
12
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
13
+ }
14
+ return cachedUint8Memory0;
16
15
  }
17
16
 
18
- function takeObject(idx) {
19
- const ret = getObject(idx);
20
- dropObject(idx);
21
- return ret;
17
+ function getStringFromWasm0(ptr, len) {
18
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
22
19
  }
23
20
 
21
+ const heap = new Array(32).fill(undefined);
22
+
23
+ heap.push(undefined, null, true, false);
24
+
25
+ let heap_next = heap.length;
26
+
24
27
  function addHeapObject(obj) {
25
28
  if (heap_next === heap.length) heap.push(heap.length + 1);
26
29
  const idx = heap_next;
@@ -30,39 +33,22 @@ function addHeapObject(obj) {
30
33
  return idx;
31
34
  }
32
35
 
33
- function isLikeNone(x) {
34
- return x === undefined || x === null;
35
- }
36
-
37
- let cachedFloat64Memory0 = new Float64Array();
36
+ function getObject(idx) { return heap[idx]; }
38
37
 
39
- function getFloat64Memory0() {
40
- if (cachedFloat64Memory0.byteLength === 0) {
41
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
42
- }
43
- return cachedFloat64Memory0;
38
+ function dropObject(idx) {
39
+ if (idx < 36) return;
40
+ heap[idx] = heap_next;
41
+ heap_next = idx;
44
42
  }
45
43
 
46
- let cachedInt32Memory0 = new Int32Array();
47
-
48
- function getInt32Memory0() {
49
- if (cachedInt32Memory0.byteLength === 0) {
50
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
51
- }
52
- return cachedInt32Memory0;
44
+ function takeObject(idx) {
45
+ const ret = getObject(idx);
46
+ dropObject(idx);
47
+ return ret;
53
48
  }
54
49
 
55
50
  let WASM_VECTOR_LEN = 0;
56
51
 
57
- let cachedUint8Memory0 = new Uint8Array();
58
-
59
- function getUint8Memory0() {
60
- if (cachedUint8Memory0.byteLength === 0) {
61
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
62
- }
63
- return cachedUint8Memory0;
64
- }
65
-
66
52
  const cachedTextEncoder = new TextEncoder('utf-8');
67
53
 
68
54
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -116,12 +102,26 @@ function passStringToWasm0(arg, malloc, realloc) {
116
102
  return ptr;
117
103
  }
118
104
 
119
- const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
105
+ function isLikeNone(x) {
106
+ return x === undefined || x === null;
107
+ }
120
108
 
121
- cachedTextDecoder.decode();
109
+ let cachedInt32Memory0 = new Int32Array();
122
110
 
123
- function getStringFromWasm0(ptr, len) {
124
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
111
+ function getInt32Memory0() {
112
+ if (cachedInt32Memory0.byteLength === 0) {
113
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
114
+ }
115
+ return cachedInt32Memory0;
116
+ }
117
+
118
+ let cachedFloat64Memory0 = new Float64Array();
119
+
120
+ function getFloat64Memory0() {
121
+ if (cachedFloat64Memory0.byteLength === 0) {
122
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
123
+ }
124
+ return cachedFloat64Memory0;
125
125
  }
126
126
 
127
127
  function debugString(val) {
@@ -223,7 +223,30 @@ function makeMutClosure(arg0, arg1, dtor, f) {
223
223
  return real;
224
224
  }
225
225
  function __wbg_adapter_46(arg0, arg1, arg2) {
226
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h81bf879b15d5b595(arg0, arg1, addHeapObject(arg2));
226
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hffe971d8143b7d78(arg0, arg1, addHeapObject(arg2));
227
+ }
228
+
229
+ /**
230
+ * @param {string} query
231
+ * @param {any} opts
232
+ * @returns {any}
233
+ */
234
+ export function browserslist(query, opts) {
235
+ try {
236
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
237
+ const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
238
+ const len0 = WASM_VECTOR_LEN;
239
+ wasm.browserslist(retptr, ptr0, len0, addHeapObject(opts));
240
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
241
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
242
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
243
+ if (r2) {
244
+ throw takeObject(r1);
245
+ }
246
+ return takeObject(r0);
247
+ } finally {
248
+ wasm.__wbindgen_add_to_stack_pointer(16);
249
+ }
227
250
  }
228
251
 
229
252
  function getCachedStringFromWasm0(ptr, len) {
@@ -241,8 +264,8 @@ function handleError(f, args) {
241
264
  wasm.__wbindgen_exn_store(addHeapObject(e));
242
265
  }
243
266
  }
244
- function __wbg_adapter_87(arg0, arg1, arg2, arg3) {
245
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h9021529d13816b40(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
267
+ function __wbg_adapter_94(arg0, arg1, arg2, arg3) {
268
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h9f8728620ba34c2e(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
246
269
  }
247
270
 
248
271
  /**
@@ -403,6 +426,58 @@ async function load(module, imports) {
403
426
  function getImports() {
404
427
  const imports = {};
405
428
  imports.wbg = {};
429
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
430
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
431
+ return addHeapObject(ret);
432
+ };
433
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
434
+ const ret = getObject(arg0) == getObject(arg1);
435
+ return ret;
436
+ };
437
+ imports.wbg.__wbindgen_is_object = function(arg0) {
438
+ const val = getObject(arg0);
439
+ const ret = typeof(val) === 'object' && val !== null;
440
+ return ret;
441
+ };
442
+ imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
443
+ const ret = getObject(arg0)[getObject(arg1)];
444
+ return addHeapObject(ret);
445
+ };
446
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
447
+ const ret = getObject(arg0) === undefined;
448
+ return ret;
449
+ };
450
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
451
+ const ret = getObject(arg0) in getObject(arg1);
452
+ return ret;
453
+ };
454
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
455
+ takeObject(arg0);
456
+ };
457
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
458
+ const obj = getObject(arg1);
459
+ const ret = typeof(obj) === 'string' ? obj : undefined;
460
+ var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
461
+ var len0 = WASM_VECTOR_LEN;
462
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
463
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
464
+ };
465
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
466
+ const v = getObject(arg0);
467
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
468
+ return ret;
469
+ };
470
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
471
+ const ret = getStringFromWasm0(arg0, arg1);
472
+ return addHeapObject(ret);
473
+ };
474
+ imports.wbg.__wbg_new_1d9a920c6bfc44a8 = function() {
475
+ const ret = new Array();
476
+ return addHeapObject(ret);
477
+ };
478
+ imports.wbg.__wbg_set_a68214f35c417fa9 = function(arg0, arg1, arg2) {
479
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
480
+ };
406
481
  imports.wbg.__wbg_new0_a57059d72c5b7aee = function() {
407
482
  const ret = new Date();
408
483
  return addHeapObject(ret);
@@ -411,9 +486,39 @@ function getImports() {
411
486
  const ret = getObject(arg0).getTimezoneOffset();
412
487
  return ret;
413
488
  };
414
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
415
- takeObject(arg0);
489
+ imports.wbg.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () {
490
+ const ret = self.self;
491
+ return addHeapObject(ret);
492
+ }, arguments) };
493
+ imports.wbg.__wbg_window_f2557cc78490aceb = function() { return handleError(function () {
494
+ const ret = window.window;
495
+ return addHeapObject(ret);
496
+ }, arguments) };
497
+ imports.wbg.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () {
498
+ const ret = globalThis.globalThis;
499
+ return addHeapObject(ret);
500
+ }, arguments) };
501
+ imports.wbg.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () {
502
+ const ret = global.global;
503
+ return addHeapObject(ret);
504
+ }, arguments) };
505
+ imports.wbg.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) {
506
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
507
+ const ret = new Function(v0);
508
+ return addHeapObject(ret);
416
509
  };
510
+ imports.wbg.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
511
+ const ret = getObject(arg0).call(getObject(arg1));
512
+ return addHeapObject(ret);
513
+ }, arguments) };
514
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
515
+ const ret = getObject(arg0);
516
+ return addHeapObject(ret);
517
+ };
518
+ imports.wbg.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
519
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
520
+ return addHeapObject(ret);
521
+ }, arguments) };
417
522
  imports.wbg.__wbg_getTime_cb82adb2556ed13e = function(arg0) {
418
523
  const ret = getObject(arg0).getTime();
419
524
  return ret;
@@ -438,23 +543,10 @@ imports.wbg.__wbg_iterator_6f9d4f28845f426c = function() {
438
543
  const ret = Symbol.iterator;
439
544
  return addHeapObject(ret);
440
545
  };
441
- imports.wbg.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
442
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
443
- return addHeapObject(ret);
444
- }, arguments) };
445
546
  imports.wbg.__wbindgen_is_function = function(arg0) {
446
547
  const ret = typeof(getObject(arg0)) === 'function';
447
548
  return ret;
448
549
  };
449
- imports.wbg.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
450
- const ret = getObject(arg0).call(getObject(arg1));
451
- return addHeapObject(ret);
452
- }, arguments) };
453
- imports.wbg.__wbindgen_is_object = function(arg0) {
454
- const val = getObject(arg0);
455
- const ret = typeof(val) === 'object' && val !== null;
456
- return ret;
457
- };
458
550
  imports.wbg.__wbg_next_579e583d33566a86 = function(arg0) {
459
551
  const ret = getObject(arg0).next;
460
552
  return addHeapObject(ret);
@@ -482,29 +574,12 @@ imports.wbg.__wbg_entries_65a76a413fc91037 = function(arg0) {
482
574
  const ret = Object.entries(getObject(arg0));
483
575
  return addHeapObject(ret);
484
576
  };
485
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
486
- const ret = getObject(arg0) == getObject(arg1);
487
- return ret;
488
- };
489
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
490
- const v = getObject(arg0);
491
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
492
- return ret;
493
- };
494
577
  imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
495
578
  const obj = getObject(arg1);
496
579
  const ret = typeof(obj) === 'number' ? obj : undefined;
497
580
  getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
498
581
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
499
582
  };
500
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
501
- const obj = getObject(arg1);
502
- const ret = typeof(obj) === 'string' ? obj : undefined;
503
- var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
504
- var len0 = WASM_VECTOR_LEN;
505
- getInt32Memory0()[arg0 / 4 + 1] = len0;
506
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
507
- };
508
583
  imports.wbg.__wbg_instanceof_Uint8Array_971eeda69eb75003 = function(arg0) {
509
584
  let result;
510
585
  try {
@@ -525,18 +600,6 @@ imports.wbg.__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b = function(arg0) {
525
600
  const ret = result;
526
601
  return ret;
527
602
  };
528
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
529
- const ret = new Error(getStringFromWasm0(arg0, arg1));
530
- return addHeapObject(ret);
531
- };
532
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
533
- const ret = getStringFromWasm0(arg0, arg1);
534
- return addHeapObject(ret);
535
- };
536
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
537
- const ret = getObject(arg0);
538
- return addHeapObject(ret);
539
- };
540
603
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
541
604
  const ret = debugString(getObject(arg1));
542
605
  const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -586,10 +649,6 @@ imports.wbg.__wbg_isArray_27c46c67f498e15d = function(arg0) {
586
649
  const ret = Array.isArray(getObject(arg0));
587
650
  return ret;
588
651
  };
589
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
590
- const ret = getObject(arg0) in getObject(arg1);
591
- return ret;
592
- };
593
652
  imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
594
653
  const ret = BigInt.asUintN(64, arg0);
595
654
  return addHeapObject(ret);
@@ -598,14 +657,6 @@ imports.wbg.__wbg_length_6e3bbe7c8bd4dbd8 = function(arg0) {
598
657
  const ret = getObject(arg0).length;
599
658
  return ret;
600
659
  };
601
- imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
602
- const ret = getObject(arg0)[getObject(arg1)];
603
- return addHeapObject(ret);
604
- };
605
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
606
- const ret = getObject(arg0) === undefined;
607
- return ret;
608
- };
609
660
  imports.wbg.__wbindgen_is_string = function(arg0) {
610
661
  const ret = typeof(getObject(arg0)) === 'string';
611
662
  return ret;
@@ -617,7 +668,7 @@ imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
617
668
  const a = state0.a;
618
669
  state0.a = 0;
619
670
  try {
620
- return __wbg_adapter_87(a, state0.b, arg0, arg1);
671
+ return __wbg_adapter_94(a, state0.b, arg0, arg1);
621
672
  } finally {
622
673
  state0.a = a;
623
674
  }
@@ -659,8 +710,8 @@ imports.wbg.__wbindgen_cb_drop = function(arg0) {
659
710
  const ret = false;
660
711
  return ret;
661
712
  };
662
- imports.wbg.__wbindgen_closure_wrapper22726 = function(arg0, arg1, arg2) {
663
- const ret = makeMutClosure(arg0, arg1, 268, __wbg_adapter_46);
713
+ imports.wbg.__wbindgen_closure_wrapper22852 = function(arg0, arg1, arg2) {
714
+ const ret = makeMutClosure(arg0, arg1, 269, __wbg_adapter_46);
664
715
  return addHeapObject(ret);
665
716
  };
666
717
 
package/wasm_bg.wasm CHANGED
Binary file