virtual-machine 0.0.14 → 0.0.15

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.
@@ -97,6 +97,26 @@ function handleError(f, args) {
97
97
  function isLikeNone(x) {
98
98
  return x === void 0 || x === null;
99
99
  }
100
+ function makeClosure(arg0, arg1, dtor, f) {
101
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
102
+ const real = (...args) => {
103
+ state.cnt++;
104
+ try {
105
+ return f(state.a, state.b, ...args);
106
+ } finally {
107
+ real._wbg_cb_unref();
108
+ }
109
+ };
110
+ real._wbg_cb_unref = () => {
111
+ if (--state.cnt === 0) {
112
+ state.dtor(state.a, state.b);
113
+ state.a = 0;
114
+ CLOSURE_DTORS.unregister(state);
115
+ }
116
+ };
117
+ CLOSURE_DTORS.register(real, state, state);
118
+ return real;
119
+ }
100
120
  function makeMutClosure(arg0, arg1, dtor, f) {
101
121
  const state = { a: arg0, b: arg1, cnt: 1, dtor };
102
122
  const real = (...args) => {
@@ -189,6 +209,9 @@ var WASM_VECTOR_LEN = 0;
189
209
  function wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919(arg0, arg1, arg2) {
190
210
  wasm.wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919(arg0, arg1, arg2);
191
211
  }
212
+ function wasm_bindgen__convert__closures_____invoke__hdce74b4265fa20da(arg0, arg1) {
213
+ wasm.wasm_bindgen__convert__closures_____invoke__hdce74b4265fa20da(arg0, arg1);
214
+ }
192
215
  var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
193
216
  }, unregister: () => {
194
217
  } } : new FinalizationRegistry((ptr) => wasm.__wbg_wasmvm_free(ptr >>> 0, 1));
@@ -359,6 +382,12 @@ function __wbg_get_imports() {
359
382
  return ret;
360
383
  }, arguments);
361
384
  };
385
+ imports.wbg.__wbg_call_c8baa5c5e72d274e = function() {
386
+ return handleError(function(arg0, arg1, arg2, arg3) {
387
+ const ret = arg0.call(arg1, arg2, arg3);
388
+ return ret;
389
+ }, arguments);
390
+ };
362
391
  imports.wbg.__wbg_datagrams_05d12f8029dbc662 = function(arg0) {
363
392
  const ret = arg0.datagrams;
364
393
  return ret;
@@ -438,6 +467,10 @@ function __wbg_get_imports() {
438
467
  imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
439
468
  queueMicrotask(arg0);
440
469
  };
470
+ imports.wbg.__wbg_random_cc1f9237d866d212 = function() {
471
+ const ret = Math.random();
472
+ return ret;
473
+ };
441
474
  imports.wbg.__wbg_read_39c4b35efcd03c25 = function(arg0) {
442
475
  const ret = arg0.read();
443
476
  return ret;
@@ -502,12 +535,20 @@ function __wbg_get_imports() {
502
535
  const ret = arg0.write(arg1);
503
536
  return ret;
504
537
  };
505
- imports.wbg.__wbindgen_cast_19eead9c9e92d417 = function(arg0, arg1) {
538
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
539
+ const ret = getStringFromWasm0(arg0, arg1);
540
+ return ret;
541
+ };
542
+ imports.wbg.__wbindgen_cast_9f0223d8557fdf20 = function(arg0, arg1) {
506
543
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hb099e2ae98169675, wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919);
507
544
  return ret;
508
545
  };
509
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
510
- const ret = getStringFromWasm0(arg0, arg1);
546
+ imports.wbg.__wbindgen_cast_c47184c56ac918cb = function(arg0, arg1) {
547
+ const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h5a236a3e5f42ce16, wasm_bindgen__convert__closures_____invoke__hdce74b4265fa20da);
548
+ return ret;
549
+ };
550
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
551
+ const ret = arg0;
511
552
  return ret;
512
553
  };
513
554
  imports.wbg.__wbindgen_init_externref_table = function() {