@next/swc-wasm-web 12.3.2-canary.21 → 12.3.2-canary.23

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 +141 -134
  3. 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": "12.3.2-canary.21",
3
+ "version": "12.3.2-canary.23",
4
4
  "files": [
5
5
  "wasm_bg.wasm",
6
6
  "wasm.js",
package/wasm.js CHANGED
@@ -30,69 +30,26 @@ function addHeapObject(obj) {
30
30
  return idx;
31
31
  }
32
32
 
33
- function debugString(val) {
34
- // primitive types
35
- const type = typeof val;
36
- if (type == 'number' || type == 'boolean' || val == null) {
37
- return `${val}`;
38
- }
39
- if (type == 'string') {
40
- return `"${val}"`;
41
- }
42
- if (type == 'symbol') {
43
- const description = val.description;
44
- if (description == null) {
45
- return 'Symbol';
46
- } else {
47
- return `Symbol(${description})`;
48
- }
49
- }
50
- if (type == 'function') {
51
- const name = val.name;
52
- if (typeof name == 'string' && name.length > 0) {
53
- return `Function(${name})`;
54
- } else {
55
- return 'Function';
56
- }
57
- }
58
- // objects
59
- if (Array.isArray(val)) {
60
- const length = val.length;
61
- let debug = '[';
62
- if (length > 0) {
63
- debug += debugString(val[0]);
64
- }
65
- for(let i = 1; i < length; i++) {
66
- debug += ', ' + debugString(val[i]);
67
- }
68
- debug += ']';
69
- return debug;
70
- }
71
- // Test for built-in
72
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
73
- let className;
74
- if (builtInMatches.length > 1) {
75
- className = builtInMatches[1];
76
- } else {
77
- // Failed to match the standard '[object ClassName]'
78
- return toString.call(val);
79
- }
80
- if (className == 'Object') {
81
- // we're a user defined class or Object
82
- // JSON.stringify avoids problems with cycles, and is generally much
83
- // easier than looping through ownProperties of `val`.
84
- try {
85
- return 'Object(' + JSON.stringify(val) + ')';
86
- } catch (_) {
87
- return 'Object';
88
- }
33
+ function isLikeNone(x) {
34
+ return x === undefined || x === null;
35
+ }
36
+
37
+ let cachedFloat64Memory0 = new Float64Array();
38
+
39
+ function getFloat64Memory0() {
40
+ if (cachedFloat64Memory0.byteLength === 0) {
41
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
89
42
  }
90
- // errors
91
- if (val instanceof Error) {
92
- return `${val.name}: ${val.message}\n${val.stack}`;
43
+ return cachedFloat64Memory0;
44
+ }
45
+
46
+ let cachedInt32Memory0 = new Int32Array();
47
+
48
+ function getInt32Memory0() {
49
+ if (cachedInt32Memory0.byteLength === 0) {
50
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
93
51
  }
94
- // TODO we could test for more things here, like `Set`s and `Map`s.
95
- return className;
52
+ return cachedInt32Memory0;
96
53
  }
97
54
 
98
55
  let WASM_VECTOR_LEN = 0;
@@ -159,34 +116,86 @@ function passStringToWasm0(arg, malloc, realloc) {
159
116
  return ptr;
160
117
  }
161
118
 
162
- let cachedInt32Memory0 = new Int32Array();
119
+ const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
163
120
 
164
- function getInt32Memory0() {
165
- if (cachedInt32Memory0.byteLength === 0) {
166
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
167
- }
168
- return cachedInt32Memory0;
169
- }
121
+ cachedTextDecoder.decode();
170
122
 
171
- function isLikeNone(x) {
172
- return x === undefined || x === null;
123
+ function getStringFromWasm0(ptr, len) {
124
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
173
125
  }
174
126
 
175
- let cachedFloat64Memory0 = new Float64Array();
176
-
177
- function getFloat64Memory0() {
178
- if (cachedFloat64Memory0.byteLength === 0) {
179
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
127
+ function debugString(val) {
128
+ // primitive types
129
+ const type = typeof val;
130
+ if (type == 'number' || type == 'boolean' || val == null) {
131
+ return `${val}`;
180
132
  }
181
- return cachedFloat64Memory0;
133
+ if (type == 'string') {
134
+ return `"${val}"`;
135
+ }
136
+ if (type == 'symbol') {
137
+ const description = val.description;
138
+ if (description == null) {
139
+ return 'Symbol';
140
+ } else {
141
+ return `Symbol(${description})`;
142
+ }
143
+ }
144
+ if (type == 'function') {
145
+ const name = val.name;
146
+ if (typeof name == 'string' && name.length > 0) {
147
+ return `Function(${name})`;
148
+ } else {
149
+ return 'Function';
150
+ }
151
+ }
152
+ // objects
153
+ if (Array.isArray(val)) {
154
+ const length = val.length;
155
+ let debug = '[';
156
+ if (length > 0) {
157
+ debug += debugString(val[0]);
158
+ }
159
+ for(let i = 1; i < length; i++) {
160
+ debug += ', ' + debugString(val[i]);
161
+ }
162
+ debug += ']';
163
+ return debug;
164
+ }
165
+ // Test for built-in
166
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
167
+ let className;
168
+ if (builtInMatches.length > 1) {
169
+ className = builtInMatches[1];
170
+ } else {
171
+ // Failed to match the standard '[object ClassName]'
172
+ return toString.call(val);
173
+ }
174
+ if (className == 'Object') {
175
+ // we're a user defined class or Object
176
+ // JSON.stringify avoids problems with cycles, and is generally much
177
+ // easier than looping through ownProperties of `val`.
178
+ try {
179
+ return 'Object(' + JSON.stringify(val) + ')';
180
+ } catch (_) {
181
+ return 'Object';
182
+ }
183
+ }
184
+ // errors
185
+ if (val instanceof Error) {
186
+ return `${val.name}: ${val.message}\n${val.stack}`;
187
+ }
188
+ // TODO we could test for more things here, like `Set`s and `Map`s.
189
+ return className;
182
190
  }
183
191
 
184
- const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
185
-
186
- cachedTextDecoder.decode();
192
+ let cachedBigInt64Memory0 = new BigInt64Array();
187
193
 
188
- function getStringFromWasm0(ptr, len) {
189
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
194
+ function getBigInt64Memory0() {
195
+ if (cachedBigInt64Memory0.byteLength === 0) {
196
+ cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
197
+ }
198
+ return cachedBigInt64Memory0;
190
199
  }
191
200
 
192
201
  function makeMutClosure(arg0, arg1, dtor, f) {
@@ -213,7 +222,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
213
222
 
214
223
  return real;
215
224
  }
216
- function __wbg_adapter_34(arg0, arg1, arg2) {
225
+ function __wbg_adapter_46(arg0, arg1, arg2) {
217
226
  wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf0bd547216a53344(arg0, arg1, addHeapObject(arg2));
218
227
  }
219
228
 
@@ -232,7 +241,7 @@ function handleError(f, args) {
232
241
  wasm.__wbindgen_exn_store(addHeapObject(e));
233
242
  }
234
243
  }
235
- function __wbg_adapter_79(arg0, arg1, arg2, arg3) {
244
+ function __wbg_adapter_87(arg0, arg1, arg2, arg3) {
236
245
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h3c64c44d7e6869aa(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
237
246
  }
238
247
 
@@ -438,27 +447,12 @@ imports.wbg.__wbg_new_8c3f0052272a457a = function(arg0) {
438
447
  imports.wbg.__wbg_set_83db9690f9353e79 = function(arg0, arg1, arg2) {
439
448
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
440
449
  };
441
- imports.wbg.__wbg_has_8359f114ce042f5a = function() { return handleError(function (arg0, arg1) {
442
- const ret = Reflect.has(getObject(arg0), getObject(arg1));
443
- return ret;
444
- }, arguments) };
445
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
446
- const ret = debugString(getObject(arg1));
447
- const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
448
- const len0 = WASM_VECTOR_LEN;
449
- getInt32Memory0()[arg0 / 4 + 1] = len0;
450
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
451
- };
452
450
  imports.wbg.__wbg_entries_65a76a413fc91037 = function(arg0) {
453
451
  const ret = Object.entries(getObject(arg0));
454
452
  return addHeapObject(ret);
455
453
  };
456
- imports.wbg.__wbindgen_is_null = function(arg0) {
457
- const ret = getObject(arg0) === null;
458
- return ret;
459
- };
460
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
461
- const ret = getObject(arg0) === undefined;
454
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
455
+ const ret = getObject(arg0) == getObject(arg1);
462
456
  return ret;
463
457
  };
464
458
  imports.wbg.__wbindgen_boolean_get = function(arg0) {
@@ -500,9 +494,8 @@ imports.wbg.__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b = function(arg0) {
500
494
  const ret = result;
501
495
  return ret;
502
496
  };
503
- imports.wbg.__wbg_new_8d2af00bc1e329ee = function(arg0, arg1) {
504
- var v0 = getCachedStringFromWasm0(arg0, arg1);
505
- const ret = new Error(v0);
497
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
498
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
506
499
  return addHeapObject(ret);
507
500
  };
508
501
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
@@ -513,10 +506,25 @@ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
513
506
  const ret = getObject(arg0);
514
507
  return addHeapObject(ret);
515
508
  };
516
- imports.wbg.__wbg_get_2268d91a19a98b92 = function(arg0, arg1) {
517
- const ret = getObject(arg0)[takeObject(arg1)];
509
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
510
+ const ret = debugString(getObject(arg1));
511
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
512
+ const len0 = WASM_VECTOR_LEN;
513
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
514
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
515
+ };
516
+ imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
517
+ const ret = getObject(arg0)[getObject(arg1)];
518
518
  return addHeapObject(ret);
519
519
  };
520
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
521
+ const ret = getObject(arg0) === undefined;
522
+ return ret;
523
+ };
524
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
525
+ const ret = getObject(arg0) in getObject(arg1);
526
+ return ret;
527
+ };
520
528
  imports.wbg.__wbindgen_is_string = function(arg0) {
521
529
  const ret = typeof(getObject(arg0)) === 'string';
522
530
  return ret;
@@ -533,16 +541,18 @@ imports.wbg.__wbindgen_is_bigint = function(arg0) {
533
541
  const ret = typeof(getObject(arg0)) === 'bigint';
534
542
  return ret;
535
543
  };
536
- imports.wbg.__wbg_BigInt_06819bca5a5bedef = function(arg0) {
537
- const ret = BigInt(getObject(arg0));
538
- return ret;
544
+ imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
545
+ const v = getObject(arg1);
546
+ const ret = typeof(v) === 'bigint' ? v : undefined;
547
+ getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0n : ret;
548
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
539
549
  };
540
- imports.wbg.__wbg_BigInt_d0c7d465bfa30d3b = function(arg0) {
541
- const ret = BigInt(arg0);
550
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
551
+ const ret = arg0;
542
552
  return addHeapObject(ret);
543
553
  };
544
- imports.wbg.__wbg_is_40a66842732708e7 = function(arg0, arg1) {
545
- const ret = Object.is(getObject(arg0), getObject(arg1));
554
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
555
+ const ret = getObject(arg0) === getObject(arg1);
546
556
  return ret;
547
557
  };
548
558
  imports.wbg.__wbg_isSafeInteger_dfa0593e8d7ac35a = function(arg0) {
@@ -553,12 +563,20 @@ imports.wbg.__wbg_isArray_27c46c67f498e15d = function(arg0) {
553
563
  const ret = Array.isArray(getObject(arg0));
554
564
  return ret;
555
565
  };
556
- imports.wbg.__wbg_BigInt_67359e71cae1c6c9 = function(arg0) {
557
- const ret = BigInt(getObject(arg0));
566
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
567
+ const ret = BigInt.asUintN(64, arg0);
568
+ return addHeapObject(ret);
569
+ };
570
+ imports.wbg.__wbg_next_aaef7c8aa5e212ac = function() { return handleError(function (arg0) {
571
+ const ret = getObject(arg0).next();
572
+ return addHeapObject(ret);
573
+ }, arguments) };
574
+ imports.wbg.__wbg_done_1b73b0672e15f234 = function(arg0) {
575
+ const ret = getObject(arg0).done;
558
576
  return ret;
559
577
  };
560
- imports.wbg.__wbg_BigInt_1fab4952b6c4a499 = function(arg0) {
561
- const ret = BigInt(BigInt.asUintN(64, arg0));
578
+ imports.wbg.__wbg_value_1ccc36bc03462d71 = function(arg0) {
579
+ const ret = getObject(arg0).value;
562
580
  return addHeapObject(ret);
563
581
  };
564
582
  imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
@@ -568,7 +586,7 @@ imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
568
586
  const a = state0.a;
569
587
  state0.a = 0;
570
588
  try {
571
- return __wbg_adapter_79(a, state0.b, arg0, arg1);
589
+ return __wbg_adapter_87(a, state0.b, arg0, arg1);
572
590
  } finally {
573
591
  state0.a = a;
574
592
  }
@@ -579,29 +597,17 @@ imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
579
597
  state0.a = state0.b = 0;
580
598
  }
581
599
  };
582
- imports.wbg.__wbg_next_aaef7c8aa5e212ac = function() { return handleError(function (arg0) {
583
- const ret = getObject(arg0).next();
600
+ imports.wbg.__wbg_new_0b9bfdd97583284e = function() {
601
+ const ret = new Object();
584
602
  return addHeapObject(ret);
585
- }, arguments) };
586
- imports.wbg.__wbg_done_1b73b0672e15f234 = function(arg0) {
587
- const ret = getObject(arg0).done;
588
- return ret;
589
603
  };
590
- imports.wbg.__wbg_value_1ccc36bc03462d71 = function(arg0) {
591
- const ret = getObject(arg0).value;
592
- return addHeapObject(ret);
604
+ imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
605
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
593
606
  };
594
607
  imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
595
608
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
596
609
  return addHeapObject(ret);
597
610
  }, arguments) };
598
- imports.wbg.__wbg_new_0b9bfdd97583284e = function() {
599
- const ret = new Object();
600
- return addHeapObject(ret);
601
- };
602
- imports.wbg.__wbg_set_c943d600fa71e4dd = function(arg0, arg1, arg2) {
603
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
604
- };
605
611
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
606
612
  throw new Error(getStringFromWasm0(arg0, arg1));
607
613
  };
@@ -623,7 +629,7 @@ imports.wbg.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) {
623
629
  return addHeapObject(ret);
624
630
  };
625
631
  imports.wbg.__wbindgen_closure_wrapper19257 = function(arg0, arg1, arg2) {
626
- const ret = makeMutClosure(arg0, arg1, 263, __wbg_adapter_34);
632
+ const ret = makeMutClosure(arg0, arg1, 264, __wbg_adapter_46);
627
633
  return addHeapObject(ret);
628
634
  };
629
635
 
@@ -637,6 +643,7 @@ function initMemory(imports, maybe_memory) {
637
643
  function finalizeInit(instance, module) {
638
644
  wasm = instance.exports;
639
645
  init.__wbindgen_wasm_module = module;
646
+ cachedBigInt64Memory0 = new BigInt64Array();
640
647
  cachedFloat64Memory0 = new Float64Array();
641
648
  cachedInt32Memory0 = new Int32Array();
642
649
  cachedUint8Memory0 = new Uint8Array();
package/wasm_bg.wasm CHANGED
Binary file