glassjar 0.2.1 → 0.3.1
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/README.md +5 -1
- package/dist/assets/{worker-BPJOu1S6.js → worker-BgBM-gEP.js} +85 -85
- package/dist/engine_bg.wasm +0 -0
- package/dist/glassjar.js +242 -235
- package/dist/glassjar.umd.cjs +2 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,7 +73,11 @@ notices and payload provenance are in `share/licenses/cpp-exceptions/` inside
|
|
|
73
73
|
## Full API
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
|
-
const engine = await Engine.create('c'); // 'c' | 'python'
|
|
76
|
+
const engine = await Engine.create('c'); // 'c' | 'python' | 'rust'
|
|
77
|
+
// The worker and its compiled compilers stay alive between runs (each run still gets a
|
|
78
|
+
// fresh instance, memory and filesystem) until idle for idleTimeoutMs (default 30 s).
|
|
79
|
+
// Errors, Debug runs and stop() replace it. Opt out with { retainWorker: false }.
|
|
80
|
+
await Engine.create('python', { retainWorker: true, idleTimeoutMs: 30_000 });
|
|
77
81
|
|
|
78
82
|
engine.fs; // DirNode — virtual filesystem, set before run()
|
|
79
83
|
engine.binaryFiles; // Record<string, Uint8Array> — optional C/C++ binary files
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
class
|
|
1
|
+
class S {
|
|
2
2
|
static __wrap(A) {
|
|
3
3
|
A = A >>> 0;
|
|
4
|
-
const g = Object.create(
|
|
5
|
-
return g.__wbg_ptr = A,
|
|
4
|
+
const g = Object.create(S.prototype);
|
|
5
|
+
return g.__wbg_ptr = A, W.register(g, g.__wbg_ptr, g), g;
|
|
6
6
|
}
|
|
7
7
|
__destroy_into_raw() {
|
|
8
8
|
const A = this.__wbg_ptr;
|
|
9
|
-
return this.__wbg_ptr = 0,
|
|
9
|
+
return this.__wbg_ptr = 0, W.unregister(this), A;
|
|
10
10
|
}
|
|
11
11
|
free() {
|
|
12
12
|
const A = this.__destroy_into_raw();
|
|
@@ -20,18 +20,18 @@ class h {
|
|
|
20
20
|
B.trap___wbg_wasmer_trap();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
Symbol.dispose && (
|
|
24
|
-
function
|
|
25
|
-
const w =
|
|
26
|
-
B.configure_compiler_toolchain(w, i, o, q,
|
|
23
|
+
Symbol.dispose && (S.prototype[Symbol.dispose] = S.prototype.free);
|
|
24
|
+
function m(C, A, g, I, Q, E) {
|
|
25
|
+
const w = O(C, B.__wbindgen_malloc), i = G, o = O(A, B.__wbindgen_malloc), q = G, h = F(g, B.__wbindgen_malloc, B.__wbindgen_realloc), p = G, d = F(I, B.__wbindgen_malloc, B.__wbindgen_realloc), z = G, f = F(Q, B.__wbindgen_malloc, B.__wbindgen_realloc), l = G;
|
|
26
|
+
B.configure_compiler_toolchain(w, i, o, q, h, p, d, z, f, l, E);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function X() {
|
|
29
29
|
B.main();
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function b(C) {
|
|
32
32
|
B.set_compiler_instance_observer(C);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function P(C) {
|
|
35
35
|
B.set_compiler_module_constructor(C);
|
|
36
36
|
}
|
|
37
37
|
function r(C) {
|
|
@@ -46,25 +46,25 @@ function n() {
|
|
|
46
46
|
return BigInt(A);
|
|
47
47
|
},
|
|
48
48
|
__wbg_Error_8c4e43fe74559d73: function(A, g) {
|
|
49
|
-
return Error(
|
|
49
|
+
return Error(k(A, g));
|
|
50
50
|
},
|
|
51
51
|
__wbg_Number_04624de7d0e8332d: function(A) {
|
|
52
52
|
return Number(A);
|
|
53
53
|
},
|
|
54
54
|
__wbg_String_8f0eb39a4a4c2f66: function(A, g) {
|
|
55
|
-
const I = String(g), Q = F(I, B.__wbindgen_malloc, B.__wbindgen_realloc), E =
|
|
55
|
+
const I = String(g), Q = F(I, B.__wbindgen_malloc, B.__wbindgen_realloc), E = G;
|
|
56
56
|
N().setInt32(A + 4, E, !0), N().setInt32(A + 0, Q, !0);
|
|
57
57
|
},
|
|
58
58
|
__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(A, g) {
|
|
59
59
|
const I = g, Q = typeof I == "bigint" ? I : void 0;
|
|
60
|
-
N().setBigInt64(A + 8,
|
|
60
|
+
N().setBigInt64(A + 8, M(Q) ? BigInt(0) : Q, !0), N().setInt32(A + 0, !M(Q), !0);
|
|
61
61
|
},
|
|
62
62
|
__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(A) {
|
|
63
63
|
const g = A, I = typeof g == "boolean" ? g : void 0;
|
|
64
|
-
return
|
|
64
|
+
return M(I) ? 16777215 : I ? 1 : 0;
|
|
65
65
|
},
|
|
66
66
|
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(A, g) {
|
|
67
|
-
const I =
|
|
67
|
+
const I = x(g), Q = F(I, B.__wbindgen_malloc, B.__wbindgen_realloc), E = G;
|
|
68
68
|
N().setInt32(A + 4, E, !0), N().setInt32(A + 0, Q, !0);
|
|
69
69
|
},
|
|
70
70
|
__wbg___wbindgen_function_table_5ae7216dfcbcc506: function() {
|
|
@@ -103,7 +103,7 @@ function n() {
|
|
|
103
103
|
},
|
|
104
104
|
__wbg___wbindgen_number_get_8ff4255516ccad3e: function(A, g) {
|
|
105
105
|
const I = g, Q = typeof I == "number" ? I : void 0;
|
|
106
|
-
N().setFloat64(A + 8,
|
|
106
|
+
N().setFloat64(A + 8, M(Q) ? 0 : Q, !0), N().setInt32(A + 0, !M(Q), !0);
|
|
107
107
|
},
|
|
108
108
|
__wbg___wbindgen_rethrow_05525c567f154472: function(A) {
|
|
109
109
|
throw A;
|
|
@@ -113,18 +113,18 @@ function n() {
|
|
|
113
113
|
},
|
|
114
114
|
__wbg___wbindgen_string_get_72fb696202c56729: function(A, g) {
|
|
115
115
|
const I = g, Q = typeof I == "string" ? I : void 0;
|
|
116
|
-
var E =
|
|
116
|
+
var E = M(Q) ? 0 : F(Q, B.__wbindgen_malloc, B.__wbindgen_realloc), w = G;
|
|
117
117
|
N().setInt32(A + 4, w, !0), N().setInt32(A + 0, E, !0);
|
|
118
118
|
},
|
|
119
119
|
__wbg___wbindgen_throw_be289d5034ed271b: function(A, g) {
|
|
120
|
-
throw new Error(
|
|
120
|
+
throw new Error(k(A, g));
|
|
121
121
|
},
|
|
122
122
|
__wbg__wbg_cb_unref_d9b87ff7982e3b21: function(A) {
|
|
123
123
|
A._wbg_cb_unref();
|
|
124
124
|
},
|
|
125
125
|
__wbg_addEventListener_3acb0aad4483804c: function() {
|
|
126
126
|
return D(function(A, g, I, Q) {
|
|
127
|
-
A.addEventListener(
|
|
127
|
+
A.addEventListener(k(g, I), Q);
|
|
128
128
|
}, arguments);
|
|
129
129
|
},
|
|
130
130
|
__wbg_apply_2e22c45cb4f12415: function() {
|
|
@@ -179,7 +179,7 @@ function n() {
|
|
|
179
179
|
return A.crypto;
|
|
180
180
|
},
|
|
181
181
|
__wbg_customSections_193491b069139fb1: function(A, g, I) {
|
|
182
|
-
return WebAssembly.Module.customSections(A,
|
|
182
|
+
return WebAssembly.Module.customSections(A, k(g, I));
|
|
183
183
|
},
|
|
184
184
|
__wbg_data_5330da50312d0bc1: function(A) {
|
|
185
185
|
return A.data;
|
|
@@ -193,7 +193,7 @@ function n() {
|
|
|
193
193
|
__wbg_error_7534b8e9a36f1ab4: function(A, g) {
|
|
194
194
|
let I, Q;
|
|
195
195
|
try {
|
|
196
|
-
I = A, Q = g, console.error(
|
|
196
|
+
I = A, Q = g, console.error(k(A, g));
|
|
197
197
|
} finally {
|
|
198
198
|
B.__wbindgen_free(I, Q, 1);
|
|
199
199
|
}
|
|
@@ -205,7 +205,7 @@ function n() {
|
|
|
205
205
|
return A.exports;
|
|
206
206
|
},
|
|
207
207
|
__wbg_fetch_d1488f40cef1e210: function(A, g, I) {
|
|
208
|
-
return A.fetch(
|
|
208
|
+
return A.fetch(k(g, I));
|
|
209
209
|
},
|
|
210
210
|
__wbg_from_bddd64e7d5ff6941: function(A) {
|
|
211
211
|
return Array.from(A);
|
|
@@ -499,10 +499,10 @@ function n() {
|
|
|
499
499
|
return new Uint8Array(s(A, g));
|
|
500
500
|
},
|
|
501
501
|
__wbg_new_no_args_1c7c842f08d00ebb: function(A, g) {
|
|
502
|
-
return new Function(
|
|
502
|
+
return new Function(k(A, g));
|
|
503
503
|
},
|
|
504
504
|
__wbg_new_with_args_7bba34e94b1cfa40: function(A, g, I, Q) {
|
|
505
|
-
return new Function(
|
|
505
|
+
return new Function(k(A, g), k(I, Q));
|
|
506
506
|
},
|
|
507
507
|
__wbg_new_with_byte_offset_9120ba79e057895b: function(A, g) {
|
|
508
508
|
return new Uint8Array(A, g >>> 0);
|
|
@@ -571,7 +571,7 @@ function n() {
|
|
|
571
571
|
},
|
|
572
572
|
__wbg_removeEventListener_e63328781a5b9af9: function() {
|
|
573
573
|
return D(function(A, g, I, Q) {
|
|
574
|
-
A.removeEventListener(
|
|
574
|
+
A.removeEventListener(k(g, I), Q);
|
|
575
575
|
}, arguments);
|
|
576
576
|
},
|
|
577
577
|
__wbg_require_b74f47fc2d022fd6: function() {
|
|
@@ -631,24 +631,24 @@ function n() {
|
|
|
631
631
|
return A.slice(g >>> 0, I >>> 0);
|
|
632
632
|
},
|
|
633
633
|
__wbg_stack_0ed75d68575b0f3c: function(A, g) {
|
|
634
|
-
const I = g.stack, Q = F(I, B.__wbindgen_malloc, B.__wbindgen_realloc), E =
|
|
634
|
+
const I = g.stack, Q = F(I, B.__wbindgen_malloc, B.__wbindgen_realloc), E = G;
|
|
635
635
|
N().setInt32(A + 4, E, !0), N().setInt32(A + 0, Q, !0);
|
|
636
636
|
},
|
|
637
637
|
__wbg_static_accessor_GLOBAL_12837167ad935116: function() {
|
|
638
638
|
const A = typeof global > "u" ? null : global;
|
|
639
|
-
return
|
|
639
|
+
return M(A) ? 0 : U(A);
|
|
640
640
|
},
|
|
641
641
|
__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
|
|
642
642
|
const A = typeof globalThis > "u" ? null : globalThis;
|
|
643
|
-
return
|
|
643
|
+
return M(A) ? 0 : U(A);
|
|
644
644
|
},
|
|
645
645
|
__wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
|
|
646
646
|
const A = typeof self > "u" ? null : self;
|
|
647
|
-
return
|
|
647
|
+
return M(A) ? 0 : U(A);
|
|
648
648
|
},
|
|
649
649
|
__wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
|
|
650
650
|
const A = typeof window > "u" ? null : window;
|
|
651
|
-
return
|
|
651
|
+
return M(A) ? 0 : U(A);
|
|
652
652
|
},
|
|
653
653
|
__wbg_store_d1d951c98d9bed41: function() {
|
|
654
654
|
return D(function(A, g, I) {
|
|
@@ -665,14 +665,14 @@ function n() {
|
|
|
665
665
|
return A.then(g);
|
|
666
666
|
},
|
|
667
667
|
__wbg_toString_56d946daff83867b: function(A, g, I) {
|
|
668
|
-
const Q = g.toString(I), E = F(Q, B.__wbindgen_malloc, B.__wbindgen_realloc), w =
|
|
668
|
+
const Q = g.toString(I), E = F(Q, B.__wbindgen_malloc, B.__wbindgen_realloc), w = G;
|
|
669
669
|
N().setInt32(A + 4, w, !0), N().setInt32(A + 0, E, !0);
|
|
670
670
|
},
|
|
671
671
|
__wbg_toString_964ff7fe6eca8362: function(A) {
|
|
672
672
|
return A.toString();
|
|
673
673
|
},
|
|
674
674
|
__wbg_trap_new: function(A) {
|
|
675
|
-
return
|
|
675
|
+
return S.__wrap(A);
|
|
676
676
|
},
|
|
677
677
|
__wbg_validate_71c2d02a71bda62f: function() {
|
|
678
678
|
return D(function(A) {
|
|
@@ -697,19 +697,19 @@ function n() {
|
|
|
697
697
|
console.warn(A, g, I);
|
|
698
698
|
},
|
|
699
699
|
__wbindgen_cast_0000000000000001: function(A, g) {
|
|
700
|
-
return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___,
|
|
700
|
+
return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, Z);
|
|
701
701
|
},
|
|
702
702
|
__wbindgen_cast_0000000000000002: function(A, g) {
|
|
703
|
-
return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___,
|
|
703
|
+
return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, Z);
|
|
704
704
|
},
|
|
705
705
|
__wbindgen_cast_0000000000000003: function(A, g) {
|
|
706
706
|
return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, _);
|
|
707
707
|
},
|
|
708
708
|
__wbindgen_cast_0000000000000004: function(A, g) {
|
|
709
|
-
return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__FnMut__wasm_bindgen_36932265c58943ab___JsValue____Output_______,
|
|
709
|
+
return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__FnMut__wasm_bindgen_36932265c58943ab___JsValue____Output_______, u);
|
|
710
710
|
},
|
|
711
711
|
__wbindgen_cast_0000000000000005: function(A, g) {
|
|
712
|
-
return gA(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______,
|
|
712
|
+
return gA(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, v);
|
|
713
713
|
},
|
|
714
714
|
__wbindgen_cast_0000000000000006: function(A, g) {
|
|
715
715
|
return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, e);
|
|
@@ -724,7 +724,7 @@ function n() {
|
|
|
724
724
|
return s(A, g);
|
|
725
725
|
},
|
|
726
726
|
__wbindgen_cast_000000000000000a: function(A, g) {
|
|
727
|
-
return
|
|
727
|
+
return k(A, g);
|
|
728
728
|
},
|
|
729
729
|
__wbindgen_cast_000000000000000b: function(A, g) {
|
|
730
730
|
return BigInt.asUintN(64, A) | BigInt.asUintN(64, g) << BigInt(64);
|
|
@@ -743,10 +743,10 @@ function n() {
|
|
|
743
743
|
}
|
|
744
744
|
};
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function u(C, A, g) {
|
|
747
747
|
B.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue_____(C, A, g);
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function v(C, A, g) {
|
|
750
750
|
B.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent_____(C, A, g);
|
|
751
751
|
}
|
|
752
752
|
function e(C, A, g) {
|
|
@@ -755,29 +755,29 @@ function e(C, A, g) {
|
|
|
755
755
|
function _(C, A, g) {
|
|
756
756
|
const I = B.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_36932265c58943ab___JsValue__(C, A, g);
|
|
757
757
|
if (I[1])
|
|
758
|
-
throw
|
|
758
|
+
throw V(I[0]);
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function Z(C, A, g) {
|
|
761
761
|
const I = B.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue__(C, A, g);
|
|
762
762
|
if (I[2])
|
|
763
|
-
throw
|
|
764
|
-
return
|
|
763
|
+
throw V(I[1]);
|
|
764
|
+
return V(I[0]);
|
|
765
765
|
}
|
|
766
766
|
function $(C, A, g, I) {
|
|
767
767
|
B.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue__wasm_bindgen_36932265c58943ab___JsValue_____(C, A, g, I);
|
|
768
768
|
}
|
|
769
769
|
typeof FinalizationRegistry > "u" || new FinalizationRegistry((C) => B.__wbg_dapadapter_free(C >>> 0, 1));
|
|
770
|
-
const
|
|
770
|
+
const W = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
771
771
|
}, unregister: () => {
|
|
772
772
|
} } : new FinalizationRegistry((C) => B.__wbg_trap_free(C >>> 0, 1));
|
|
773
773
|
function U(C) {
|
|
774
774
|
const A = B.__externref_table_alloc();
|
|
775
775
|
return B.__wbindgen_externrefs.set(A, C), A;
|
|
776
776
|
}
|
|
777
|
-
const
|
|
777
|
+
const a = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
778
778
|
}, unregister: () => {
|
|
779
779
|
} } : new FinalizationRegistry((C) => C.dtor(C.a, C.b));
|
|
780
|
-
function
|
|
780
|
+
function x(C) {
|
|
781
781
|
const A = typeof C;
|
|
782
782
|
if (A == "number" || A == "boolean" || C == null)
|
|
783
783
|
return `${C}`;
|
|
@@ -794,9 +794,9 @@ function Z(C) {
|
|
|
794
794
|
if (Array.isArray(C)) {
|
|
795
795
|
const Q = C.length;
|
|
796
796
|
let E = "[";
|
|
797
|
-
Q > 0 && (E +=
|
|
797
|
+
Q > 0 && (E += x(C[0]));
|
|
798
798
|
for (let w = 1; w < Q; w++)
|
|
799
|
-
E += ", " +
|
|
799
|
+
E += ", " + x(C[w]);
|
|
800
800
|
return E += "]", E;
|
|
801
801
|
}
|
|
802
802
|
const g = /\[object ([^\]]+)\]/.exec(toString.call(C));
|
|
@@ -828,7 +828,7 @@ let K = null;
|
|
|
828
828
|
function N() {
|
|
829
829
|
return (K === null || K.buffer.detached === !0 || K.buffer.detached === void 0 && K.buffer !== B.memory.buffer) && (K = new DataView(B.memory.buffer)), K;
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function k(C, A) {
|
|
832
832
|
return C = C >>> 0, CA(C, A);
|
|
833
833
|
}
|
|
834
834
|
let J = null;
|
|
@@ -843,7 +843,7 @@ function D(C, A) {
|
|
|
843
843
|
B.__wbindgen_exn_store(I);
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function M(C) {
|
|
847
847
|
return C == null;
|
|
848
848
|
}
|
|
849
849
|
function gA(C, A, g, I) {
|
|
@@ -856,8 +856,8 @@ function gA(C, A, g, I) {
|
|
|
856
856
|
}
|
|
857
857
|
};
|
|
858
858
|
return E._wbg_cb_unref = () => {
|
|
859
|
-
--Q.cnt === 0 && (Q.dtor(Q.a, Q.b), Q.a = 0,
|
|
860
|
-
},
|
|
859
|
+
--Q.cnt === 0 && (Q.dtor(Q.a, Q.b), Q.a = 0, a.unregister(Q));
|
|
860
|
+
}, a.register(E, Q, Q), E;
|
|
861
861
|
}
|
|
862
862
|
function Y(C, A, g, I) {
|
|
863
863
|
const Q = { a: C, b: A, cnt: 1, dtor: g }, E = (...w) => {
|
|
@@ -871,17 +871,17 @@ function Y(C, A, g, I) {
|
|
|
871
871
|
}
|
|
872
872
|
};
|
|
873
873
|
return E._wbg_cb_unref = () => {
|
|
874
|
-
--Q.cnt === 0 && (Q.dtor(Q.a, Q.b), Q.a = 0,
|
|
875
|
-
},
|
|
874
|
+
--Q.cnt === 0 && (Q.dtor(Q.a, Q.b), Q.a = 0, a.unregister(Q));
|
|
875
|
+
}, a.register(E, Q, Q), E;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function O(C, A) {
|
|
878
878
|
const g = A(C.length * 1, 1) >>> 0;
|
|
879
|
-
return R().set(C, g / 1),
|
|
879
|
+
return R().set(C, g / 1), G = C.length, g;
|
|
880
880
|
}
|
|
881
881
|
function F(C, A, g) {
|
|
882
882
|
if (g === void 0) {
|
|
883
|
-
const i =
|
|
884
|
-
return R().subarray(o, o + i.length).set(i),
|
|
883
|
+
const i = L.encode(C), o = A(i.length, 1) >>> 0;
|
|
884
|
+
return R().subarray(o, o + i.length).set(i), G = i.length, o;
|
|
885
885
|
}
|
|
886
886
|
let I = C.length, Q = A(I, 1) >>> 0;
|
|
887
887
|
const E = R();
|
|
@@ -893,31 +893,31 @@ function F(C, A, g) {
|
|
|
893
893
|
}
|
|
894
894
|
if (w !== I) {
|
|
895
895
|
w !== 0 && (C = C.slice(w)), Q = g(Q, I, I = w + C.length * 3, 1) >>> 0;
|
|
896
|
-
const i = R().subarray(Q + w, Q + I), o =
|
|
896
|
+
const i = R().subarray(Q + w, Q + I), o = L.encodeInto(C, i);
|
|
897
897
|
w += o.written, Q = g(Q, I, w, 1) >>> 0;
|
|
898
898
|
}
|
|
899
|
-
return
|
|
899
|
+
return G = w, Q;
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function V(C) {
|
|
902
902
|
const A = B.__wbindgen_externrefs.get(C);
|
|
903
903
|
return B.__externref_table_dealloc(C), A;
|
|
904
904
|
}
|
|
905
905
|
let c = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
906
906
|
c.decode();
|
|
907
907
|
const IA = 2146435072;
|
|
908
|
-
let
|
|
908
|
+
let t = 0;
|
|
909
909
|
function CA(C, A) {
|
|
910
|
-
return
|
|
910
|
+
return t += A, t >= IA && (c = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), c.decode(), t = A), c.decode(R().subarray(C, C + A));
|
|
911
911
|
}
|
|
912
|
-
const
|
|
913
|
-
"encodeInto" in
|
|
914
|
-
const g =
|
|
912
|
+
const L = new TextEncoder();
|
|
913
|
+
"encodeInto" in L || (L.encodeInto = function(C, A) {
|
|
914
|
+
const g = L.encode(C);
|
|
915
915
|
return A.set(g), {
|
|
916
916
|
read: C.length,
|
|
917
917
|
written: g.length
|
|
918
918
|
};
|
|
919
919
|
});
|
|
920
|
-
let
|
|
920
|
+
let G = 0, B;
|
|
921
921
|
function QA(C, A) {
|
|
922
922
|
return B = C.exports, K = null, J = null, B.__wbindgen_start(), B;
|
|
923
923
|
}
|
|
@@ -956,7 +956,7 @@ async function EA(C) {
|
|
|
956
956
|
const { instance: g, module: I } = await BA(await C, A);
|
|
957
957
|
return QA(g);
|
|
958
958
|
}
|
|
959
|
-
var DA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.
|
|
959
|
+
var DA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.3.1/dist/engine_bg.wasm");
|
|
960
960
|
class wA {
|
|
961
961
|
enabled = !1;
|
|
962
962
|
verified;
|
|
@@ -1006,8 +1006,8 @@ class wA {
|
|
|
1006
1006
|
if (this.stats.compareMs += performance.now() - i, q)
|
|
1007
1007
|
return this.stats.hits++, this.publishStats(), o.module;
|
|
1008
1008
|
this.stats.misses++, this.retained = void 0;
|
|
1009
|
-
const
|
|
1010
|
-
return this.retained = { module:
|
|
1009
|
+
const h = this.compile(Q);
|
|
1010
|
+
return this.retained = { module: h, bytes: Q, sha256: E }, this.send({ type: "compiler_module", value: this.retained }), this.publishStats(), h;
|
|
1011
1011
|
}
|
|
1012
1012
|
/** Called after a fresh compiler WASI environment and Instance have been created. */
|
|
1013
1013
|
instantiated(A) {
|
|
@@ -1054,15 +1054,15 @@ function iA(C, A) {
|
|
|
1054
1054
|
if (C[g] !== A[g]) return !1;
|
|
1055
1055
|
return !0;
|
|
1056
1056
|
}
|
|
1057
|
-
const
|
|
1057
|
+
const T = "glassjar-wasm:";
|
|
1058
1058
|
function oA(C, A) {
|
|
1059
1059
|
const g = new URL(String(C), A);
|
|
1060
1060
|
if (g.protocol !== "https:" && g.protocol !== "http:")
|
|
1061
1061
|
throw new TypeError(`Engine Wasm must be served over http(s), not ${g.protocol}`);
|
|
1062
1062
|
return g.href;
|
|
1063
1063
|
}
|
|
1064
|
-
let y = { scopeEpoch: 0, operationId: 0, cacheEpoch: 0 },
|
|
1065
|
-
const
|
|
1064
|
+
let y = { scopeEpoch: 0, operationId: 0, cacheEpoch: 0 }, j;
|
|
1065
|
+
const H = new wA(
|
|
1066
1066
|
(C) => postMessage({ ...C, ...y })
|
|
1067
1067
|
);
|
|
1068
1068
|
addEventListener(
|
|
@@ -1071,7 +1071,7 @@ addEventListener(
|
|
|
1071
1071
|
const A = C.data;
|
|
1072
1072
|
if (A?.type === "configure_cpp") {
|
|
1073
1073
|
if (C.stopImmediatePropagation(), !A.toolchain) throw new Error("Missing verified compiler seed");
|
|
1074
|
-
|
|
1074
|
+
H.configureVerified(A.toolchain, A.cacheCompilerModule), m(
|
|
1075
1075
|
A.toolchain.compiler,
|
|
1076
1076
|
A.toolchain.sysroot,
|
|
1077
1077
|
A.toolchain.compilerHash,
|
|
@@ -1083,10 +1083,10 @@ addEventListener(
|
|
|
1083
1083
|
C.stopImmediatePropagation();
|
|
1084
1084
|
const g = A;
|
|
1085
1085
|
if (g.scopeEpoch === y.scopeEpoch && g.operationId === y.operationId && g.cacheEpoch === y.cacheEpoch) {
|
|
1086
|
-
const I =
|
|
1087
|
-
|
|
1086
|
+
const I = j;
|
|
1087
|
+
j = void 0, I?.();
|
|
1088
1088
|
}
|
|
1089
|
-
} else typeof A?.operation_id == "number" && (
|
|
1089
|
+
} else typeof A?.operation_id == "number" && (H.beginOperation(), y = {
|
|
1090
1090
|
scopeEpoch: A.scope_epoch,
|
|
1091
1091
|
operationId: A.operation_id,
|
|
1092
1092
|
cacheEpoch: A.cache_epoch
|
|
@@ -1094,16 +1094,16 @@ addEventListener(
|
|
|
1094
1094
|
}
|
|
1095
1095
|
);
|
|
1096
1096
|
try {
|
|
1097
|
-
const C = self.name.startsWith(
|
|
1098
|
-
await EA({ module_or_path: C ?? DA }),
|
|
1099
|
-
(A) =>
|
|
1097
|
+
const C = self.name.startsWith(T) ? oA(self.name.slice(T.length)) : void 0;
|
|
1098
|
+
await EA({ module_or_path: C ?? DA }), P(
|
|
1099
|
+
(A) => H.constructVerified(A)
|
|
1100
1100
|
), r(
|
|
1101
1101
|
() => new Promise((A) => {
|
|
1102
|
-
|
|
1102
|
+
j = A, postMessage({ type: "object_build_complete", ...y });
|
|
1103
1103
|
})
|
|
1104
|
-
),
|
|
1105
|
-
(A) =>
|
|
1106
|
-
),
|
|
1104
|
+
), b(
|
|
1105
|
+
(A) => H.instantiated(A)
|
|
1106
|
+
), X();
|
|
1107
1107
|
} catch (C) {
|
|
1108
1108
|
postMessage({
|
|
1109
1109
|
type: "error",
|
package/dist/engine_bg.wasm
CHANGED
|
Binary file
|