hakuban 0.7.1 → 0.7.3

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/hakuban.js CHANGED
@@ -1,13 +1,39 @@
1
1
  let wasm;
2
2
 
3
+ const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
4
+
5
+ cachedTextDecoder.decode();
6
+
7
+ let cachedUint8Memory0 = new Uint8Array();
8
+
9
+ function getUint8Memory0() {
10
+ if (cachedUint8Memory0.byteLength === 0) {
11
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
12
+ }
13
+ return cachedUint8Memory0;
14
+ }
15
+
16
+ function getStringFromWasm0(ptr, len) {
17
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
18
+ }
19
+
3
20
  const heap = new Array(32).fill(undefined);
4
21
 
5
22
  heap.push(undefined, null, true, false);
6
23
 
7
- function getObject(idx) { return heap[idx]; }
8
-
9
24
  let heap_next = heap.length;
10
25
 
26
+ function addHeapObject(obj) {
27
+ if (heap_next === heap.length) heap.push(heap.length + 1);
28
+ const idx = heap_next;
29
+ heap_next = heap[idx];
30
+
31
+ heap[idx] = obj;
32
+ return idx;
33
+ }
34
+
35
+ function getObject(idx) { return heap[idx]; }
36
+
11
37
  function dropObject(idx) {
12
38
  if (idx < 36) return;
13
39
  heap[idx] = heap_next;
@@ -22,15 +48,6 @@ function takeObject(idx) {
22
48
 
23
49
  let WASM_VECTOR_LEN = 0;
24
50
 
25
- let cachedUint8Memory0 = new Uint8Array();
26
-
27
- function getUint8Memory0() {
28
- if (cachedUint8Memory0.byteLength === 0) {
29
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
30
- }
31
- return cachedUint8Memory0;
32
- }
33
-
34
51
  const cachedTextEncoder = new TextEncoder('utf-8');
35
52
 
36
53
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -97,23 +114,6 @@ function getInt32Memory0() {
97
114
  return cachedInt32Memory0;
98
115
  }
99
116
 
100
- const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
101
-
102
- cachedTextDecoder.decode();
103
-
104
- function getStringFromWasm0(ptr, len) {
105
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
106
- }
107
-
108
- function addHeapObject(obj) {
109
- if (heap_next === heap.length) heap.push(heap.length + 1);
110
- const idx = heap_next;
111
- heap_next = heap[idx];
112
-
113
- heap[idx] = obj;
114
- return idx;
115
- }
116
-
117
117
  function debugString(val) {
118
118
  // primitive types
119
119
  const type = typeof val;
@@ -966,6 +966,10 @@ async function load(module, imports) {
966
966
  function getImports() {
967
967
  const imports = {};
968
968
  imports.wbg = {};
969
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
970
+ const ret = getStringFromWasm0(arg0, arg1);
971
+ return addHeapObject(ret);
972
+ };
969
973
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
970
974
  takeObject(arg0);
971
975
  };
@@ -977,14 +981,6 @@ function getImports() {
977
981
  getInt32Memory0()[arg0 / 4 + 1] = len0;
978
982
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
979
983
  };
980
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
981
- const ret = getStringFromWasm0(arg0, arg1);
982
- return addHeapObject(ret);
983
- };
984
- imports.wbg.__wbg_now_8172cd917e5eda6b = function(arg0) {
985
- const ret = getObject(arg0).now();
986
- return ret;
987
- };
988
984
  imports.wbg.__wbg_debug_f15cb542ea509609 = function(arg0) {
989
985
  console.debug(getObject(arg0));
990
986
  };
@@ -1000,6 +996,10 @@ function getImports() {
1000
996
  imports.wbg.__wbg_warn_58110c4a199df084 = function(arg0) {
1001
997
  console.warn(getObject(arg0));
1002
998
  };
999
+ imports.wbg.__wbg_now_8172cd917e5eda6b = function(arg0) {
1000
+ const ret = getObject(arg0).now();
1001
+ return ret;
1002
+ };
1003
1003
  imports.wbg.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) {
1004
1004
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1005
1005
  return addHeapObject(ret);