@componentor/quickjs-ng-wasmfile-release-asyncify 0.31.0

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/LICENSE ADDED
@@ -0,0 +1,49 @@
1
+ quickjs-emscripten:
2
+ The MIT License
3
+
4
+ quickjs-emscripten copyright (c) 2019-2024 Jake Teton-Landis
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+
24
+
25
+ quickjs-ng:
26
+ The MIT License (MIT)
27
+
28
+ Copyright (c) 2017-2021 Fabrice Bellard
29
+ Copyright (c) 2017-2021 Charlie Gordon
30
+ Copyright (c) 2023 Ben Noordhuis
31
+ Copyright (c) 2023 Saúl Ibarra Corretgé
32
+
33
+ Permission is hereby granted, free of charge, to any person obtaining a copy
34
+ of this software and associated documentation files (the "Software"), to deal
35
+ in the Software without restriction, including without limitation the rights
36
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37
+ copies of the Software, and to permit persons to whom the Software is
38
+ furnished to do so, subject to the following conditions:
39
+
40
+ The above copyright notice and this permission notice shall be included in
41
+ all copies or substantial portions of the Software.
42
+
43
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
46
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
49
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # @componentor/quickjs-ng-wasmfile-release-asyncify
2
+
3
+ Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.
4
+
5
+ This generated package is part of [quickjs-emscripten](https://github.com/componentor/quickjs-emscripten).
6
+ It contains a variant of the quickjs WASM library, and can be used with @componentor/quickjs-emscripten-core.
7
+
8
+ ```typescript
9
+ import variant from "@componentor/quickjs-ng-wasmfile-release-asyncify"
10
+ import { newQuickJSAsyncWASMModuleFromVariant } from "@componentor/quickjs-emscripten-core"
11
+ const QuickJS = await newQuickJSAsyncWASMModuleFromVariant(variant)
12
+ ```
13
+
14
+ This variant was built with the following settings:
15
+
16
+ ## Library: quickjs-ng
17
+
18
+ [quickjs-ng](https://github.com/quickjs-ng/quickjs) is a fork of quickjs that tends to add features more quickly.
19
+
20
+ Version [git+7ded62c5](https://github.com/quickjs-ng/quickjs/commit/7ded62c536fca860b8106c39fb75f2df8fe27180) vendored to quickjs-emscripten on 2024-02-12.
21
+
22
+ ## Release mode: release
23
+
24
+ Optimized for performance; use when building/deploying your application.
25
+
26
+ ## Exports: require import browser workerd
27
+
28
+ Exports the following in package.json for the package entrypoint:
29
+
30
+ - Exports a NodeJS-compatible CommonJS module, which is faster to load and run compared to an ESModule.
31
+ - Exports a NodeJS-compatible ESModule. Cannot be imported synchronously from a NodeJS CommonJS module.
32
+ - Exports a browser-compatible ESModule, designed to work in browsers and browser-like environments.
33
+ - Targets Cloudflare Workers.
34
+
35
+ ## Extra async magic? Yes
36
+
37
+ Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs.
38
+
39
+ ## Single-file, or separate .wasm file? wasm
40
+
41
+ Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant.
42
+
43
+ ## More details
44
+
45
+ Full variant JSON description:
46
+
47
+ ```json
48
+ {
49
+ "library": "quickjs-ng",
50
+ "releaseMode": "release",
51
+ "syncMode": "asyncify",
52
+ "description": "Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.",
53
+ "emscriptenInclusion": "wasm",
54
+ "exports": {
55
+ "require": {
56
+ "emscriptenEnvironment": ["node"]
57
+ },
58
+ "import": {
59
+ "emscriptenEnvironment": ["node"]
60
+ },
61
+ "browser": {
62
+ "emscriptenEnvironment": ["web", "worker"]
63
+ },
64
+ "workerd": {
65
+ "emscriptenEnvironment": ["web"]
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ Variant-specific Emscripten build flags:
72
+
73
+ ```json
74
+ [
75
+ "-s ASYNCIFY=1",
76
+ "-DQTS_ASYNCIFY=1",
77
+ "-DQTS_ASYNCIFY_DEFAULT_STACK_SIZE=81920",
78
+ "-s ASYNCIFY_STACK_SIZE=81920",
79
+ "-s ASYNCIFY_REMOVE=@$(BUILD_WRAPPER)/asyncify-remove.json",
80
+ "-s ASYNCIFY_IMPORTS=@$(BUILD_WRAPPER)/asyncify-imports.json",
81
+ "-lasync.js",
82
+ "-Oz",
83
+ "-flto",
84
+ "--closure 1",
85
+ "-s FILESYSTEM=0",
86
+ "--pre-js $(TEMPLATES)/pre-extension.js",
87
+ "--pre-js $(TEMPLATES)/pre-wasmMemory.js"
88
+ ]
89
+ ```
@@ -0,0 +1,18 @@
1
+ // Generated from ../../templates/emscripten-module.ASYNCIFY.d.ts
2
+ import type {
3
+ EmscriptenModuleLoader,
4
+ QuickJSAsyncEmscriptenModule,
5
+ } from "@componentor/quickjs-ffi-types"
6
+ /**
7
+ * Emscripten module built from [`quickjs/quickjs.h`](../quickjs/quickjs.h) and
8
+ * our FFI support functions [c/interface.c](../c/interface.c), compiled with -s
9
+ * ASYNCIFY=1.
10
+ *
11
+ * Because this version is built with ASYNCIFY, the C code can call asynchronous
12
+ * Javascript functions as though they were synchronous.
13
+ *
14
+ * Note that emscripten modules returned by a `MODULARIZE=1` emscripten build
15
+ * (like this one) load asynchronously.
16
+ */
17
+ declare const ModuleLoader: EmscriptenModuleLoader<QuickJSAsyncEmscriptenModule>
18
+ export default ModuleLoader
@@ -0,0 +1,48 @@
1
+
2
+ var QuickJSRaw = (() => {
3
+ var _scriptName = import.meta.url;
4
+
5
+ return (
6
+ function(moduleArg = {}) {
7
+ var moduleRtn;
8
+
9
+ var c=moduleArg,aa,f,ba=new Promise((a,b)=>{aa=a;f=b}),ca="object"==typeof window,m="function"==typeof importScripts;function p(a){a={log:a||function(){}};for(const b of p.Xa)b(a);return c.quickJSEmscriptenExtensions=a}p.Xa=[];c.quickjsEmscriptenInit=p;p.Xa.push(a=>{a.getWasmMemory=function(){return r}});var da=Object.assign({},c),ea="./this.program",t="",fa,u;
10
+ if(ca||m)m?t=self.location.href:"undefined"!=typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptName&&(t=_scriptName),t.startsWith("blob:")?t="":t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1),m&&(u=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),fa=a=>fetch(a,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)));
11
+ var ha=c.print||console.log.bind(console),w=c.printErr||console.error.bind(console);Object.assign(c,da);da=null;c.thisProgram&&(ea=c.thisProgram);var x=c.wasmBinary,r,z=!1,A,B,C,D,F;function ia(){var a=r.buffer;c.HEAP8=B=new Int8Array(a);c.HEAP16=new Int16Array(a);c.HEAPU8=C=new Uint8Array(a);c.HEAPU16=new Uint16Array(a);c.HEAP32=D=new Int32Array(a);c.HEAPU32=F=new Uint32Array(a);c.HEAPF32=new Float32Array(a);c.HEAPF64=new Float64Array(a)}
12
+ c.wasmMemory?r=c.wasmMemory:r=new WebAssembly.Memory({initial:(c.INITIAL_MEMORY||16777216)/65536,maximum:32768});ia();var ja=[],ka=[],la=[];function ma(){var a=c.preRun.shift();ja.unshift(a)}var G=0,H=null,I=null;function J(a){c.onAbort?.(a);a="Aborted("+a+")";w(a);z=!0;A=1;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");f(a);throw a;}var na=a=>a.startsWith("data:application/octet-stream;base64,"),K;
13
+ function oa(a){if(a==K&&x)return new Uint8Array(x);if(u)return u(a);throw"both async and sync fetching of the wasm failed";}function pa(a){return x?Promise.resolve().then(()=>oa(a)):fa(a).then(b=>new Uint8Array(b),()=>oa(a))}function qa(a,b,d){return pa(a).then(e=>WebAssembly.instantiate(e,b)).then(d,e=>{w(`failed to asynchronously prepare wasm: ${e}`);J(e)})}
14
+ function ra(a,b){var d=K;return x||"function"!=typeof WebAssembly.instantiateStreaming||na(d)||"function"!=typeof fetch?qa(d,a,b):fetch(d,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(b,function(g){w(`wasm streaming compile failed: ${g}`);w("falling back to ArrayBuffer instantiation");return qa(d,a,b)}))}function sa(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}
15
+ var L=a=>{for(;0<a.length;)a.shift()(c)},M=c.noExitRuntime||!0,ta="undefined"!=typeof TextDecoder?new TextDecoder:void 0,N=(a,b,d)=>{var e=b+d;for(d=b;a[d]&&!(d>=e);)++d;if(16<d-b&&a.buffer&&ta)return ta.decode(a.subarray(b,d));for(e="";b<d;){var g=a[b++];if(g&128){var h=a[b++]&63;if(192==(g&224))e+=String.fromCharCode((g&31)<<6|h);else{var k=a[b++]&63;g=224==(g&240)?(g&15)<<12|h<<6|k:(g&7)<<18|h<<12|k<<6|a[b++]&63;65536>g?e+=String.fromCharCode(g):(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|
16
+ g&1023))}}else e+=String.fromCharCode(g)}return e},ua=[0,31,60,91,121,152,182,213,244,274,305,335],va=[0,31,59,90,120,151,181,212,243,273,304,334],O={},wa=a=>{if(!(a instanceof sa||"unwind"==a))throw a;},P=0,xa=a=>{A=a;M||0<P||(c.onExit?.(a),z=!0);throw new sa(a);},ya=a=>{if(!z)try{if(a(),!(M||0<P))try{A=a=A,xa(a)}catch(b){wa(b)}}catch(b){wa(b)}},Q;Q=()=>performance.now();
17
+ var R=(a,b,d)=>{var e=C;if(!(0<d))return 0;var g=b;d=b+d-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var l=a.charCodeAt(++h);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(b>=d)break;e[b++]=k}else{if(2047>=k){if(b+1>=d)break;e[b++]=192|k>>6}else{if(65535>=k){if(b+2>=d)break;e[b++]=224|k>>12}else{if(b+3>=d)break;e[b++]=240|k>>18;e[b++]=128|k>>12&63}e[b++]=128|k>>6&63}e[b++]=128|k&63}}e[b]=0;return b-g},S={},za=()=>{if(!T){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",
18
+ PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ea||"./this.program"},b;for(b in S)void 0===S[b]?delete a[b]:a[b]=S[b];var d=[];for(b in a)d.push(`${b}=${a[b]}`);T=d}return T},T,Aa=[null,[],[]],U=a=>{try{a()}catch(b){J(b)}};
19
+ function Ba(){var a=V,b={};for(let [d,e]of Object.entries(a))b[d]="function"==typeof e?(...g)=>{W.push(d);try{return e(...g)}finally{z||(W.pop(),X&&1===Y&&0===W.length&&(Y=0,U(Ca),"undefined"!=typeof Fibers&&Fibers.$a()))}}:e;return b}var Y=0,Da=81920,X=null,Ea=0,W=[],Fa={},Ga={},Ia=0,Ja=null,Ka=[];function La(){return new Promise((a,b)=>{Ja={resolve:a,reject:b}})}
20
+ function Ma(){var a=Na(12+Da),b=a+12,d=Da;F[a>>2]=b;F[a+4>>2]=b+d;b=W[0];d=Fa[b];void 0===d&&(d=Ia++,Fa[b]=d,Ga[d]=b);D[a+8>>2]=d;return a}
21
+ function Oa(a){if(!z){if(0===Y){var b=!1,d=!1;a((e=0)=>{if(!z&&(Ea=e,b=!0,d)){Y=2;U(()=>Pa(X));"undefined"!=typeof Browser&&Browser.Oa.Ya&&Browser.Oa.resume();e=!1;try{var g=(0,V[Ga[D[X+8>>2]]])()}catch(l){g=l,e=!0}var h=!1;if(!X){var k=Ja;k&&(Ja=null,(e?k.reject:k.resolve)(g),h=!0)}if(e&&!h)throw g;}});d=!0;b||(Y=1,X=Ma(),"undefined"!=typeof Browser&&Browser.Oa.Ya&&Browser.Oa.pause(),U(()=>Qa(X)))}else 2===Y?(Y=0,U(Ra),Sa(X),X=null,Ka.forEach(ya)):J(`invalid state: ${Y}`);return Ea}}
22
+ var Ta=a=>{for(var b=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);127>=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++d):b+=3}return b},Xa=(a,b,d,e,g)=>{function h(n){--P;0!==v&&Ua(v);return"string"===b?n?N(C,n):"":"boolean"===b?!!n:n}var k={string:n=>{var y=0;if(null!==n&&void 0!==n&&0!==n){y=Ta(n)+1;var Ha=Va(y);R(n,Ha,y);y=Ha}return y},array:n=>{var y=Va(n.length);B.set(n,y);return y}};a=c["_"+a];var l=[],v=0;if(e)for(var q=0;q<e.length;q++){var E=k[d[q]];E?(0===v&&(v=Wa()),l[q]=E(e[q])):l[q]=e[q]}d=
23
+ X;e=a(...l);g=g?.async;P+=1;if(X!=d)return La().then(h);e=h(e);return g?Promise.resolve(e):e},Za={b:(a,b,d,e)=>{J(`Assertion failed: ${a?N(C,a):""}, at: `+[b?b?N(C,b):"":"unknown filename",d,e?e?N(C,e):"":"unknown function"])},s:()=>{J("")},q:()=>1,n:()=>{M=!1;P=0},i:function(a,b,d){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));D[d>>2]=a.getSeconds();D[d+4>>2]=a.getMinutes();D[d+8>>2]=a.getHours();D[d+12>>2]=a.getDate();D[d+16>>2]=a.getMonth();D[d+20>>2]=a.getFullYear()-1900;
24
+ D[d+24>>2]=a.getDay();b=a.getFullYear();D[d+28>>2]=(0!==b%4||0===b%100&&0!==b%400?va:ua)[a.getMonth()]+a.getDate()-1|0;D[d+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();D[d+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},l:(a,b)=>{O[a]&&(clearTimeout(O[a].id),delete O[a]);if(!b)return 0;var d=setTimeout(()=>{delete O[a];ya(()=>Ya(a,Q()))},b);O[a]={id:d,Za:b};return 0},o:(a,b,d,e)=>{var g=(new Date).getFullYear(),
25
+ h=(new Date(g,0,1)).getTimezoneOffset();g=(new Date(g,6,1)).getTimezoneOffset();F[a>>2]=60*Math.max(h,g);D[b>>2]=Number(h!=g);b=k=>{var l=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(l/60)).padStart(2,"0")}${String(l%60).padStart(2,"0")}`};a=b(h);b=b(g);g<h?(R(a,d,17),R(b,e,17)):(R(a,e,17),R(b,d,17))},r:()=>Date.now(),p:Q,m:a=>{var b=C.length;a>>>=0;if(2147483648<a)return!1;for(var d=1;4>=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,
26
+ e)/65536))-r.buffer.byteLength+65535)/65536;try{r.grow(e);ia();var g=1;break a}catch(h){}g=void 0}if(g)return!0}return!1},e:(a,b)=>{var d=0;za().forEach((e,g)=>{var h=b+d;g=F[a+4*g>>2]=h;for(h=0;h<e.length;++h)B[g++]=e.charCodeAt(h);B[g]=0;d+=e.length+1});return 0},f:(a,b)=>{var d=za();F[a>>2]=d.length;var e=0;d.forEach(g=>e+=g.length+1);F[b>>2]=e;return 0},d:()=>52,k:function(){return 70},c:(a,b,d,e)=>{for(var g=0,h=0;h<d;h++){var k=F[b>>2],l=F[b+4>>2];b+=8;for(var v=0;v<l;v++){var q=C[k+v],E=Aa[a];
27
+ 0===q||10===q?((1===a?ha:w)(N(E,0)),E.length=0):E.push(q)}g+=l}F[e>>2]=g;return 0},a:r,t:xa,u:function(a,b,d,e,g){return c.callbacks.callFunction({handleSleep:Oa},a,b,d,e,g)},j:function(a){return c.callbacks.shouldInterrupt(void 0,a)},h:function(a,b,d){const e={handleSleep:Oa};d=d?N(C,d):"";return c.callbacks.loadModuleSource(e,a,b,d)},g:function(a,b,d,e){const g={handleSleep:Oa};d=d?N(C,d):"";e=e?N(C,e):"";return c.callbacks.normalizeModule(g,a,b,d,e)},v:function(a,b){Da=a||b}},V=function(){function a(d){V=
28
+ d.exports;V=Ba();ka.unshift(V.w);G--;c.monitorRunDependencies?.(G);0==G&&(null!==H&&(clearInterval(H),H=null),I&&(d=I,I=null,d()));return V}var b={a:Za};G++;c.monitorRunDependencies?.(G);if(c.instantiateWasm)try{return c.instantiateWasm(b,a)}catch(d){w(`Module.instantiateWasm callback failed with error: ${d}`),f(d)}K||=c.locateFile?na("emscripten-module.wasm")?"emscripten-module.wasm":c.locateFile?c.locateFile("emscripten-module.wasm",t):t+"emscripten-module.wasm":(new URL("emscripten-module.wasm",
29
+ import.meta.url)).href;ra(b,function(d){a(d.instance)}).catch(f);return{}}(),Na=c._malloc=a=>(Na=c._malloc=V.x)(a);c._QTS_Throw=(a,b)=>(c._QTS_Throw=V.y)(a,b);c._QTS_NewError=a=>(c._QTS_NewError=V.z)(a);c._QTS_RuntimeSetMemoryLimit=(a,b)=>(c._QTS_RuntimeSetMemoryLimit=V.A)(a,b);c._QTS_RuntimeComputeMemoryUsage=(a,b)=>(c._QTS_RuntimeComputeMemoryUsage=V.B)(a,b);c._QTS_RuntimeDumpMemoryUsage=a=>(c._QTS_RuntimeDumpMemoryUsage=V.C)(a);
30
+ c._QTS_RecoverableLeakCheck=()=>(c._QTS_RecoverableLeakCheck=V.D)();c._QTS_BuildIsSanitizeLeak=()=>(c._QTS_BuildIsSanitizeLeak=V.E)();c._QTS_RuntimeSetMaxStackSize=(a,b)=>(c._QTS_RuntimeSetMaxStackSize=V.F)(a,b);c._QTS_GetUndefined=()=>(c._QTS_GetUndefined=V.G)();c._QTS_GetNull=()=>(c._QTS_GetNull=V.H)();c._QTS_GetFalse=()=>(c._QTS_GetFalse=V.I)();c._QTS_GetTrue=()=>(c._QTS_GetTrue=V.J)();c._QTS_NewRuntime=()=>(c._QTS_NewRuntime=V.K)();c._QTS_FreeRuntime=a=>(c._QTS_FreeRuntime=V.L)(a);
31
+ var Sa=c._free=a=>(Sa=c._free=V.M)(a);c._QTS_NewContext=(a,b)=>(c._QTS_NewContext=V.N)(a,b);c._QTS_FreeContext=a=>(c._QTS_FreeContext=V.O)(a);c._QTS_FreeValuePointer=(a,b)=>(c._QTS_FreeValuePointer=V.P)(a,b);c._QTS_FreeValuePointerRuntime=(a,b)=>(c._QTS_FreeValuePointerRuntime=V.Q)(a,b);c._QTS_FreeVoidPointer=(a,b)=>(c._QTS_FreeVoidPointer=V.R)(a,b);c._QTS_FreeCString=(a,b)=>(c._QTS_FreeCString=V.S)(a,b);c._QTS_DupValuePointer=(a,b)=>(c._QTS_DupValuePointer=V.T)(a,b);
32
+ c._QTS_NewObject=a=>(c._QTS_NewObject=V.U)(a);c._QTS_NewObjectProto=(a,b)=>(c._QTS_NewObjectProto=V.V)(a,b);c._QTS_NewArray=a=>(c._QTS_NewArray=V.W)(a);c._QTS_NewArrayBuffer=(a,b,d)=>(c._QTS_NewArrayBuffer=V.X)(a,b,d);c._QTS_NewFloat64=(a,b)=>(c._QTS_NewFloat64=V.Y)(a,b);c._QTS_GetFloat64=(a,b)=>(c._QTS_GetFloat64=V.Z)(a,b);c._QTS_NewString=(a,b)=>(c._QTS_NewString=V._)(a,b);c._QTS_GetString=(a,b)=>(c._QTS_GetString=V.$)(a,b);c._QTS_GetArrayBuffer=(a,b)=>(c._QTS_GetArrayBuffer=V.aa)(a,b);
33
+ c._QTS_GetArrayBufferLength=(a,b)=>(c._QTS_GetArrayBufferLength=V.ba)(a,b);c._QTS_NewSymbol=(a,b,d)=>(c._QTS_NewSymbol=V.ca)(a,b,d);c._QTS_GetSymbolDescriptionOrKey=(a,b)=>(c._QTS_GetSymbolDescriptionOrKey=V.da)(a,b);c._QTS_IsGlobalSymbol=(a,b)=>(c._QTS_IsGlobalSymbol=V.ea)(a,b);c._QTS_IsJobPending=a=>(c._QTS_IsJobPending=V.fa)(a);c._QTS_ExecutePendingJob=(a,b,d)=>(c._QTS_ExecutePendingJob=V.ga)(a,b,d);c._QTS_GetProp=(a,b,d)=>(c._QTS_GetProp=V.ha)(a,b,d);
34
+ c._QTS_GetPropNumber=(a,b,d)=>(c._QTS_GetPropNumber=V.ia)(a,b,d);c._QTS_SetProp=(a,b,d,e)=>(c._QTS_SetProp=V.ja)(a,b,d,e);c._QTS_DefineProp=(a,b,d,e,g,h,k,l,v)=>(c._QTS_DefineProp=V.ka)(a,b,d,e,g,h,k,l,v);c._QTS_GetOwnPropertyNames=(a,b,d,e,g)=>(c._QTS_GetOwnPropertyNames=V.la)(a,b,d,e,g);c._QTS_Call=(a,b,d,e,g)=>(c._QTS_Call=V.ma)(a,b,d,e,g);c._QTS_ResolveException=(a,b)=>(c._QTS_ResolveException=V.na)(a,b);c._QTS_Dump=(a,b)=>(c._QTS_Dump=V.oa)(a,b);
35
+ c._QTS_Eval=(a,b,d,e,g,h)=>(c._QTS_Eval=V.pa)(a,b,d,e,g,h);c._QTS_GetModuleNamespace=(a,b)=>(c._QTS_GetModuleNamespace=V.qa)(a,b);c._QTS_Typeof=(a,b)=>(c._QTS_Typeof=V.ra)(a,b);c._QTS_GetLength=(a,b,d)=>(c._QTS_GetLength=V.sa)(a,b,d);c._QTS_IsEqual=(a,b,d,e)=>(c._QTS_IsEqual=V.ta)(a,b,d,e);c._QTS_GetGlobalObject=a=>(c._QTS_GetGlobalObject=V.ua)(a);c._QTS_NewPromiseCapability=(a,b)=>(c._QTS_NewPromiseCapability=V.va)(a,b);c._QTS_PromiseState=(a,b)=>(c._QTS_PromiseState=V.wa)(a,b);
36
+ c._QTS_PromiseResult=(a,b)=>(c._QTS_PromiseResult=V.xa)(a,b);c._QTS_TestStringArg=a=>(c._QTS_TestStringArg=V.ya)(a);c._QTS_GetDebugLogEnabled=a=>(c._QTS_GetDebugLogEnabled=V.za)(a);c._QTS_SetDebugLogEnabled=(a,b)=>(c._QTS_SetDebugLogEnabled=V.Aa)(a,b);c._QTS_BuildIsDebug=()=>(c._QTS_BuildIsDebug=V.Ba)();c._QTS_BuildIsAsyncify=()=>(c._QTS_BuildIsAsyncify=V.Ca)();c._QTS_NewFunction=(a,b,d)=>(c._QTS_NewFunction=V.Da)(a,b,d);
37
+ c._QTS_ArgvGetJSValueConstPointer=(a,b)=>(c._QTS_ArgvGetJSValueConstPointer=V.Ea)(a,b);c._QTS_RuntimeEnableInterruptHandler=a=>(c._QTS_RuntimeEnableInterruptHandler=V.Fa)(a);c._QTS_RuntimeDisableInterruptHandler=a=>(c._QTS_RuntimeDisableInterruptHandler=V.Ga)(a);c._QTS_RuntimeEnableModuleLoader=(a,b)=>(c._QTS_RuntimeEnableModuleLoader=V.Ha)(a,b);c._QTS_RuntimeDisableModuleLoader=a=>(c._QTS_RuntimeDisableModuleLoader=V.Ia)(a);c._QTS_bjson_encode=(a,b)=>(c._QTS_bjson_encode=V.Ja)(a,b);
38
+ c._QTS_bjson_decode=(a,b)=>(c._QTS_bjson_decode=V.Ka)(a,b);c._QTS_EvalFunction=(a,b)=>(c._QTS_EvalFunction=V.La)(a,b);c._QTS_EncodeBytecode=(a,b)=>(c._QTS_EncodeBytecode=V.Ma)(a,b);c._QTS_DecodeBytecode=(a,b)=>(c._QTS_DecodeBytecode=V.Na)(a,b);var Ya=(a,b)=>(Ya=V.Pa)(a,b),Ua=a=>(Ua=V.Qa)(a),Va=a=>(Va=V.Ra)(a),Wa=()=>(Wa=V.Sa)(),Qa=a=>(Qa=V.Ta)(a),Ca=()=>(Ca=V.Ua)(),Pa=a=>(Pa=V.Va)(a),Ra=()=>(Ra=V.Wa)();
39
+ c.cwrap=(a,b,d,e)=>{var g=!d||d.every(h=>"number"===h||"boolean"===h);return"string"!==b&&g&&!e?c["_"+a]:(...h)=>Xa(a,b,d,h,e)};c.UTF8ToString=(a,b)=>a?N(C,a,b):"";c.stringToUTF8=(a,b,d)=>R(a,b,d);c.lengthBytesUTF8=Ta;var Z;I=function $a(){Z||ab();Z||(I=$a)};
40
+ function ab(){function a(){if(!Z&&(Z=!0,c.calledRun=!0,!z)){L(ka);aa(c);c.onRuntimeInitialized?.();if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;){var b=c.postRun.shift();la.unshift(b)}L(la)}}if(!(0<G)){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)ma();L(ja);0<G||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1);a()},1)):a())}}
41
+ if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();ab();moduleRtn=ba;
42
+
43
+
44
+ return moduleRtn;
45
+ }
46
+ );
47
+ })();
48
+ export default QuickJSRaw;
@@ -0,0 +1,49 @@
1
+
2
+ var QuickJSRaw = (() => {
3
+ var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
4
+ if (typeof __filename != 'undefined') _scriptName ||= __filename;
5
+ return (
6
+ function(moduleArg = {}) {
7
+ var moduleRtn;
8
+
9
+ var c=moduleArg,aa,f,ba=new Promise((a,b)=>{aa=a;f=b});function m(a){a={log:a||function(){}};for(const b of m.Xa)b(a);return c.quickJSEmscriptenExtensions=a}m.Xa=[];c.quickjsEmscriptenInit=m;m.Xa.push(a=>{a.getWasmMemory=function(){return p}});var ca=Object.assign({},c),r="./this.program",t=(a,b)=>{throw b;},v="",da,w,fs=require("fs"),ea=require("path");v=__dirname+"/";w=a=>{a=fa(a)?new URL(a):ea.normalize(a);return fs.readFileSync(a)};
10
+ da=a=>{a=fa(a)?new URL(a):ea.normalize(a);return new Promise((b,d)=>{fs.readFile(a,void 0,(e,g)=>{e?d(e):b(g.buffer)})})};!c.thisProgram&&1<process.argv.length&&(r=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);t=(a,b)=>{process.exitCode=a;throw b;};var ha=c.print||console.log.bind(console),y=c.printErr||console.error.bind(console);Object.assign(c,ca);ca=null;c.thisProgram&&(r=c.thisProgram);var z=c.wasmBinary,p,A=!1,B,D,E,F,G;
11
+ function ia(){var a=p.buffer;c.HEAP8=D=new Int8Array(a);c.HEAP16=new Int16Array(a);c.HEAPU8=E=new Uint8Array(a);c.HEAPU16=new Uint16Array(a);c.HEAP32=F=new Int32Array(a);c.HEAPU32=G=new Uint32Array(a);c.HEAPF32=new Float32Array(a);c.HEAPF64=new Float64Array(a)}c.wasmMemory?p=c.wasmMemory:p=new WebAssembly.Memory({initial:(c.INITIAL_MEMORY||16777216)/65536,maximum:32768});ia();var ja=[],ka=[],la=[];function ma(){var a=c.preRun.shift();ja.unshift(a)}var H=0,I=null,J=null;
12
+ function K(a){c.onAbort?.(a);a="Aborted("+a+")";y(a);A=!0;B=1;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");f(a);throw a;}var na=a=>a.startsWith("data:application/octet-stream;base64,"),fa=a=>a.startsWith("file://"),L;function oa(a){if(a==L&&z)return new Uint8Array(z);if(w)return w(a);throw"both async and sync fetching of the wasm failed";}function pa(){var a=L;return z?Promise.resolve().then(()=>oa(a)):da(a).then(b=>new Uint8Array(b),()=>oa(a))}
13
+ function qa(a,b){return pa().then(d=>WebAssembly.instantiate(d,a)).then(b,d=>{y(`failed to asynchronously prepare wasm: ${d}`);K(d)})}function ra(a,b){return qa(a,b)}function M(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}
14
+ var N=a=>{for(;0<a.length;)a.shift()(c)},O=c.noExitRuntime||!0,sa="undefined"!=typeof TextDecoder?new TextDecoder:void 0,P=(a,b,d)=>{var e=b+d;for(d=b;a[d]&&!(d>=e);)++d;if(16<d-b&&a.buffer&&sa)return sa.decode(a.subarray(b,d));for(e="";b<d;){var g=a[b++];if(g&128){var h=a[b++]&63;if(192==(g&224))e+=String.fromCharCode((g&31)<<6|h);else{var k=a[b++]&63;g=224==(g&240)?(g&15)<<12|h<<6|k:(g&7)<<18|h<<12|k<<6|a[b++]&63;65536>g?e+=String.fromCharCode(g):(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|
15
+ g&1023))}}else e+=String.fromCharCode(g)}return e},ta=[0,31,60,91,121,152,182,213,244,274,305,335],ua=[0,31,59,90,120,151,181,212,243,273,304,334],Q={},R=0,va=a=>{B=a;O||0<R||(c.onExit?.(a),A=!0);t(a,new M(a))},wa=a=>{if(!A)try{if(a(),!(O||0<R))try{B=a=B,va(a)}catch(b){b instanceof M||"unwind"==b||t(1,b)}}catch(b){b instanceof M||"unwind"==b||t(1,b)}},S;S=()=>performance.now();
16
+ var T=(a,b,d)=>{var e=E;if(!(0<d))return 0;var g=b;d=b+d-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var l=a.charCodeAt(++h);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(b>=d)break;e[b++]=k}else{if(2047>=k){if(b+1>=d)break;e[b++]=192|k>>6}else{if(65535>=k){if(b+2>=d)break;e[b++]=224|k>>12}else{if(b+3>=d)break;e[b++]=240|k>>18;e[b++]=128|k>>12&63}e[b++]=128|k>>6&63}e[b++]=128|k&63}}e[b]=0;return b-g},xa={},za=()=>{if(!ya){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",
17
+ PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:r||"./this.program"},b;for(b in xa)void 0===xa[b]?delete a[b]:a[b]=xa[b];var d=[];for(b in a)d.push(`${b}=${a[b]}`);ya=d}return ya},ya,Aa=[null,[],[]],U=a=>{try{a()}catch(b){K(b)}};
18
+ function Ba(){var a=V,b={};for(let [d,e]of Object.entries(a))b[d]="function"==typeof e?(...g)=>{W.push(d);try{return e(...g)}finally{A||(W.pop(),X&&1===Y&&0===W.length&&(Y=0,U(Ca),"undefined"!=typeof Fibers&&Fibers.$a()))}}:e;return b}var Y=0,Da=81920,X=null,Ea=0,W=[],Fa={},Ha={},Ia=0,Ja=null,Ka=[];function La(){return new Promise((a,b)=>{Ja={resolve:a,reject:b}})}
19
+ function Ma(){var a=Na(12+Da),b=a+12,d=Da;G[a>>2]=b;G[a+4>>2]=b+d;b=W[0];d=Fa[b];void 0===d&&(d=Ia++,Fa[b]=d,Ha[d]=b);F[a+8>>2]=d;return a}
20
+ function Oa(a){if(!A){if(0===Y){var b=!1,d=!1;a((e=0)=>{if(!A&&(Ea=e,b=!0,d)){Y=2;U(()=>Pa(X));"undefined"!=typeof Browser&&Browser.Oa.Ya&&Browser.Oa.resume();e=!1;try{var g=(0,V[Ha[F[X+8>>2]]])()}catch(l){g=l,e=!0}var h=!1;if(!X){var k=Ja;k&&(Ja=null,(e?k.reject:k.resolve)(g),h=!0)}if(e&&!h)throw g;}});d=!0;b||(Y=1,X=Ma(),"undefined"!=typeof Browser&&Browser.Oa.Ya&&Browser.Oa.pause(),U(()=>Qa(X)))}else 2===Y?(Y=0,U(Ra),Sa(X),X=null,Ka.forEach(wa)):K(`invalid state: ${Y}`);return Ea}}
21
+ var Ta=a=>{for(var b=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);127>=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++d):b+=3}return b},Xa=(a,b,d,e,g)=>{function h(n){--R;0!==u&&Ua(u);return"string"===b?n?P(E,n):"":"boolean"===b?!!n:n}var k={string:n=>{var x=0;if(null!==n&&void 0!==n&&0!==n){x=Ta(n)+1;var Ga=Va(x);T(n,Ga,x);x=Ga}return x},array:n=>{var x=Va(n.length);D.set(n,x);return x}};a=c["_"+a];var l=[],u=0;if(e)for(var q=0;q<e.length;q++){var C=k[d[q]];C?(0===u&&(u=Wa()),l[q]=C(e[q])):l[q]=e[q]}d=
22
+ X;e=a(...l);g=g?.async;R+=1;if(X!=d)return La().then(h);e=h(e);return g?Promise.resolve(e):e},Za={b:(a,b,d,e)=>{K(`Assertion failed: ${a?P(E,a):""}, at: `+[b?b?P(E,b):"":"unknown filename",d,e?e?P(E,e):"":"unknown function"])},s:()=>{K("")},q:()=>1,n:()=>{O=!1;R=0},i:function(a,b,d){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));F[d>>2]=a.getSeconds();F[d+4>>2]=a.getMinutes();F[d+8>>2]=a.getHours();F[d+12>>2]=a.getDate();F[d+16>>2]=a.getMonth();F[d+20>>2]=a.getFullYear()-1900;
23
+ F[d+24>>2]=a.getDay();b=a.getFullYear();F[d+28>>2]=(0!==b%4||0===b%100&&0!==b%400?ua:ta)[a.getMonth()]+a.getDate()-1|0;F[d+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();F[d+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},l:(a,b)=>{Q[a]&&(clearTimeout(Q[a].id),delete Q[a]);if(!b)return 0;var d=setTimeout(()=>{delete Q[a];wa(()=>Ya(a,S()))},b);Q[a]={id:d,Za:b};return 0},o:(a,b,d,e)=>{var g=(new Date).getFullYear(),
24
+ h=(new Date(g,0,1)).getTimezoneOffset();g=(new Date(g,6,1)).getTimezoneOffset();G[a>>2]=60*Math.max(h,g);F[b>>2]=Number(h!=g);b=k=>{var l=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(l/60)).padStart(2,"0")}${String(l%60).padStart(2,"0")}`};a=b(h);b=b(g);g<h?(T(a,d,17),T(b,e,17)):(T(a,e,17),T(b,d,17))},r:()=>Date.now(),p:S,m:a=>{var b=E.length;a>>>=0;if(2147483648<a)return!1;for(var d=1;4>=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,
25
+ e)/65536))-p.buffer.byteLength+65535)/65536;try{p.grow(e);ia();var g=1;break a}catch(h){}g=void 0}if(g)return!0}return!1},e:(a,b)=>{var d=0;za().forEach((e,g)=>{var h=b+d;g=G[a+4*g>>2]=h;for(h=0;h<e.length;++h)D[g++]=e.charCodeAt(h);D[g]=0;d+=e.length+1});return 0},f:(a,b)=>{var d=za();G[a>>2]=d.length;var e=0;d.forEach(g=>e+=g.length+1);G[b>>2]=e;return 0},d:()=>52,k:function(){return 70},c:(a,b,d,e)=>{for(var g=0,h=0;h<d;h++){var k=G[b>>2],l=G[b+4>>2];b+=8;for(var u=0;u<l;u++){var q=E[k+u],C=Aa[a];
26
+ 0===q||10===q?((1===a?ha:y)(P(C,0)),C.length=0):C.push(q)}g+=l}G[e>>2]=g;return 0},a:p,t:va,u:function(a,b,d,e,g){return c.callbacks.callFunction({handleSleep:Oa},a,b,d,e,g)},j:function(a){return c.callbacks.shouldInterrupt(void 0,a)},h:function(a,b,d){const e={handleSleep:Oa};d=d?P(E,d):"";return c.callbacks.loadModuleSource(e,a,b,d)},g:function(a,b,d,e){const g={handleSleep:Oa};d=d?P(E,d):"";e=e?P(E,e):"";return c.callbacks.normalizeModule(g,a,b,d,e)},v:function(a,b){Da=a||b}},V=function(){function a(d){V=
27
+ d.exports;V=Ba();ka.unshift(V.w);H--;c.monitorRunDependencies?.(H);0==H&&(null!==I&&(clearInterval(I),I=null),J&&(d=J,J=null,d()));return V}var b={a:Za};H++;c.monitorRunDependencies?.(H);if(c.instantiateWasm)try{return c.instantiateWasm(b,a)}catch(d){y(`Module.instantiateWasm callback failed with error: ${d}`),f(d)}L||=na("emscripten-module.wasm")?"emscripten-module.wasm":c.locateFile?c.locateFile("emscripten-module.wasm",v):v+"emscripten-module.wasm";ra(b,function(d){a(d.instance)}).catch(f);return{}}(),
28
+ Na=c._malloc=a=>(Na=c._malloc=V.x)(a);c._QTS_Throw=(a,b)=>(c._QTS_Throw=V.y)(a,b);c._QTS_NewError=a=>(c._QTS_NewError=V.z)(a);c._QTS_RuntimeSetMemoryLimit=(a,b)=>(c._QTS_RuntimeSetMemoryLimit=V.A)(a,b);c._QTS_RuntimeComputeMemoryUsage=(a,b)=>(c._QTS_RuntimeComputeMemoryUsage=V.B)(a,b);c._QTS_RuntimeDumpMemoryUsage=a=>(c._QTS_RuntimeDumpMemoryUsage=V.C)(a);c._QTS_RecoverableLeakCheck=()=>(c._QTS_RecoverableLeakCheck=V.D)();c._QTS_BuildIsSanitizeLeak=()=>(c._QTS_BuildIsSanitizeLeak=V.E)();
29
+ c._QTS_RuntimeSetMaxStackSize=(a,b)=>(c._QTS_RuntimeSetMaxStackSize=V.F)(a,b);c._QTS_GetUndefined=()=>(c._QTS_GetUndefined=V.G)();c._QTS_GetNull=()=>(c._QTS_GetNull=V.H)();c._QTS_GetFalse=()=>(c._QTS_GetFalse=V.I)();c._QTS_GetTrue=()=>(c._QTS_GetTrue=V.J)();c._QTS_NewRuntime=()=>(c._QTS_NewRuntime=V.K)();c._QTS_FreeRuntime=a=>(c._QTS_FreeRuntime=V.L)(a);var Sa=c._free=a=>(Sa=c._free=V.M)(a);c._QTS_NewContext=(a,b)=>(c._QTS_NewContext=V.N)(a,b);c._QTS_FreeContext=a=>(c._QTS_FreeContext=V.O)(a);
30
+ c._QTS_FreeValuePointer=(a,b)=>(c._QTS_FreeValuePointer=V.P)(a,b);c._QTS_FreeValuePointerRuntime=(a,b)=>(c._QTS_FreeValuePointerRuntime=V.Q)(a,b);c._QTS_FreeVoidPointer=(a,b)=>(c._QTS_FreeVoidPointer=V.R)(a,b);c._QTS_FreeCString=(a,b)=>(c._QTS_FreeCString=V.S)(a,b);c._QTS_DupValuePointer=(a,b)=>(c._QTS_DupValuePointer=V.T)(a,b);c._QTS_NewObject=a=>(c._QTS_NewObject=V.U)(a);c._QTS_NewObjectProto=(a,b)=>(c._QTS_NewObjectProto=V.V)(a,b);c._QTS_NewArray=a=>(c._QTS_NewArray=V.W)(a);
31
+ c._QTS_NewArrayBuffer=(a,b,d)=>(c._QTS_NewArrayBuffer=V.X)(a,b,d);c._QTS_NewFloat64=(a,b)=>(c._QTS_NewFloat64=V.Y)(a,b);c._QTS_GetFloat64=(a,b)=>(c._QTS_GetFloat64=V.Z)(a,b);c._QTS_NewString=(a,b)=>(c._QTS_NewString=V._)(a,b);c._QTS_GetString=(a,b)=>(c._QTS_GetString=V.$)(a,b);c._QTS_GetArrayBuffer=(a,b)=>(c._QTS_GetArrayBuffer=V.aa)(a,b);c._QTS_GetArrayBufferLength=(a,b)=>(c._QTS_GetArrayBufferLength=V.ba)(a,b);c._QTS_NewSymbol=(a,b,d)=>(c._QTS_NewSymbol=V.ca)(a,b,d);
32
+ c._QTS_GetSymbolDescriptionOrKey=(a,b)=>(c._QTS_GetSymbolDescriptionOrKey=V.da)(a,b);c._QTS_IsGlobalSymbol=(a,b)=>(c._QTS_IsGlobalSymbol=V.ea)(a,b);c._QTS_IsJobPending=a=>(c._QTS_IsJobPending=V.fa)(a);c._QTS_ExecutePendingJob=(a,b,d)=>(c._QTS_ExecutePendingJob=V.ga)(a,b,d);c._QTS_GetProp=(a,b,d)=>(c._QTS_GetProp=V.ha)(a,b,d);c._QTS_GetPropNumber=(a,b,d)=>(c._QTS_GetPropNumber=V.ia)(a,b,d);c._QTS_SetProp=(a,b,d,e)=>(c._QTS_SetProp=V.ja)(a,b,d,e);
33
+ c._QTS_DefineProp=(a,b,d,e,g,h,k,l,u)=>(c._QTS_DefineProp=V.ka)(a,b,d,e,g,h,k,l,u);c._QTS_GetOwnPropertyNames=(a,b,d,e,g)=>(c._QTS_GetOwnPropertyNames=V.la)(a,b,d,e,g);c._QTS_Call=(a,b,d,e,g)=>(c._QTS_Call=V.ma)(a,b,d,e,g);c._QTS_ResolveException=(a,b)=>(c._QTS_ResolveException=V.na)(a,b);c._QTS_Dump=(a,b)=>(c._QTS_Dump=V.oa)(a,b);c._QTS_Eval=(a,b,d,e,g,h)=>(c._QTS_Eval=V.pa)(a,b,d,e,g,h);c._QTS_GetModuleNamespace=(a,b)=>(c._QTS_GetModuleNamespace=V.qa)(a,b);
34
+ c._QTS_Typeof=(a,b)=>(c._QTS_Typeof=V.ra)(a,b);c._QTS_GetLength=(a,b,d)=>(c._QTS_GetLength=V.sa)(a,b,d);c._QTS_IsEqual=(a,b,d,e)=>(c._QTS_IsEqual=V.ta)(a,b,d,e);c._QTS_GetGlobalObject=a=>(c._QTS_GetGlobalObject=V.ua)(a);c._QTS_NewPromiseCapability=(a,b)=>(c._QTS_NewPromiseCapability=V.va)(a,b);c._QTS_PromiseState=(a,b)=>(c._QTS_PromiseState=V.wa)(a,b);c._QTS_PromiseResult=(a,b)=>(c._QTS_PromiseResult=V.xa)(a,b);c._QTS_TestStringArg=a=>(c._QTS_TestStringArg=V.ya)(a);
35
+ c._QTS_GetDebugLogEnabled=a=>(c._QTS_GetDebugLogEnabled=V.za)(a);c._QTS_SetDebugLogEnabled=(a,b)=>(c._QTS_SetDebugLogEnabled=V.Aa)(a,b);c._QTS_BuildIsDebug=()=>(c._QTS_BuildIsDebug=V.Ba)();c._QTS_BuildIsAsyncify=()=>(c._QTS_BuildIsAsyncify=V.Ca)();c._QTS_NewFunction=(a,b,d)=>(c._QTS_NewFunction=V.Da)(a,b,d);c._QTS_ArgvGetJSValueConstPointer=(a,b)=>(c._QTS_ArgvGetJSValueConstPointer=V.Ea)(a,b);c._QTS_RuntimeEnableInterruptHandler=a=>(c._QTS_RuntimeEnableInterruptHandler=V.Fa)(a);
36
+ c._QTS_RuntimeDisableInterruptHandler=a=>(c._QTS_RuntimeDisableInterruptHandler=V.Ga)(a);c._QTS_RuntimeEnableModuleLoader=(a,b)=>(c._QTS_RuntimeEnableModuleLoader=V.Ha)(a,b);c._QTS_RuntimeDisableModuleLoader=a=>(c._QTS_RuntimeDisableModuleLoader=V.Ia)(a);c._QTS_bjson_encode=(a,b)=>(c._QTS_bjson_encode=V.Ja)(a,b);c._QTS_bjson_decode=(a,b)=>(c._QTS_bjson_decode=V.Ka)(a,b);c._QTS_EvalFunction=(a,b)=>(c._QTS_EvalFunction=V.La)(a,b);c._QTS_EncodeBytecode=(a,b)=>(c._QTS_EncodeBytecode=V.Ma)(a,b);
37
+ c._QTS_DecodeBytecode=(a,b)=>(c._QTS_DecodeBytecode=V.Na)(a,b);var Ya=(a,b)=>(Ya=V.Pa)(a,b),Ua=a=>(Ua=V.Qa)(a),Va=a=>(Va=V.Ra)(a),Wa=()=>(Wa=V.Sa)(),Qa=a=>(Qa=V.Ta)(a),Ca=()=>(Ca=V.Ua)(),Pa=a=>(Pa=V.Va)(a),Ra=()=>(Ra=V.Wa)();c.cwrap=(a,b,d,e)=>{var g=!d||d.every(h=>"number"===h||"boolean"===h);return"string"!==b&&g&&!e?c["_"+a]:(...h)=>Xa(a,b,d,h,e)};c.UTF8ToString=(a,b)=>a?P(E,a,b):"";c.stringToUTF8=(a,b,d)=>T(a,b,d);c.lengthBytesUTF8=Ta;var Z;J=function $a(){Z||ab();Z||(J=$a)};
38
+ function ab(){function a(){if(!Z&&(Z=!0,c.calledRun=!0,!A)){N(ka);aa(c);c.onRuntimeInitialized?.();if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;){var b=c.postRun.shift();la.unshift(b)}N(la)}}if(!(0<H)){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)ma();N(ja);0<H||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1);a()},1)):a())}}
39
+ if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();ab();moduleRtn=ba;
40
+
41
+
42
+ return moduleRtn;
43
+ }
44
+ );
45
+ })();
46
+ if (typeof exports === 'object' && typeof module === 'object')
47
+ module.exports = QuickJSRaw;
48
+ else if (typeof define === 'function' && define['amd'])
49
+ define([], () => QuickJSRaw);
@@ -0,0 +1,50 @@
1
+
2
+ var QuickJSRaw = (() => {
3
+ var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
4
+
5
+ return (
6
+ function(moduleArg = {}) {
7
+ var moduleRtn;
8
+
9
+ var c=moduleArg,aa,f,ba=new Promise((a,b)=>{aa=a;f=b});function m(a){a={log:a||function(){}};for(const b of m.Xa)b(a);return c.quickJSEmscriptenExtensions=a}m.Xa=[];c.quickjsEmscriptenInit=m;m.Xa.push(a=>{a.getWasmMemory=function(){return p}});var ca=Object.assign({},c),da="./this.program",r="",ea;"undefined"!=typeof document&&document.currentScript&&(r=document.currentScript.src);_scriptName&&(r=_scriptName);r.startsWith("blob:")?r="":r=r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1);
10
+ ea=a=>fetch(a,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)));var fa=c.print||console.log.bind(console),t=c.printErr||console.error.bind(console);Object.assign(c,ca);ca=null;c.thisProgram&&(da=c.thisProgram);var v=c.wasmBinary,p,w=!1,x,z,A,B,C;
11
+ function ha(){var a=p.buffer;c.HEAP8=z=new Int8Array(a);c.HEAP16=new Int16Array(a);c.HEAPU8=A=new Uint8Array(a);c.HEAPU16=new Uint16Array(a);c.HEAP32=B=new Int32Array(a);c.HEAPU32=C=new Uint32Array(a);c.HEAPF32=new Float32Array(a);c.HEAPF64=new Float64Array(a)}c.wasmMemory?p=c.wasmMemory:p=new WebAssembly.Memory({initial:(c.INITIAL_MEMORY||16777216)/65536,maximum:32768});ha();var ia=[],ja=[],ka=[];function la(){var a=c.preRun.shift();ia.unshift(a)}var D=0,F=null,G=null;
12
+ function H(a){c.onAbort?.(a);a="Aborted("+a+")";t(a);w=!0;x=1;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");f(a);throw a;}var ma=a=>a.startsWith("data:application/octet-stream;base64,"),I;function na(a){if(a==I&&v)return new Uint8Array(v);throw"both async and sync fetching of the wasm failed";}function oa(a){return v?Promise.resolve().then(()=>na(a)):ea(a).then(b=>new Uint8Array(b),()=>na(a))}
13
+ function pa(a,b,d){return oa(a).then(e=>WebAssembly.instantiate(e,b)).then(d,e=>{t(`failed to asynchronously prepare wasm: ${e}`);H(e)})}function qa(a,b){var d=I;return v||"function"!=typeof WebAssembly.instantiateStreaming||ma(d)||"function"!=typeof fetch?pa(d,a,b):fetch(d,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(b,function(g){t(`wasm streaming compile failed: ${g}`);t("falling back to ArrayBuffer instantiation");return pa(d,a,b)}))}
14
+ function ra(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}
15
+ var J=a=>{for(;0<a.length;)a.shift()(c)},K=c.noExitRuntime||!0,sa="undefined"!=typeof TextDecoder?new TextDecoder:void 0,L=(a,b,d)=>{var e=b+d;for(d=b;a[d]&&!(d>=e);)++d;if(16<d-b&&a.buffer&&sa)return sa.decode(a.subarray(b,d));for(e="";b<d;){var g=a[b++];if(g&128){var h=a[b++]&63;if(192==(g&224))e+=String.fromCharCode((g&31)<<6|h);else{var k=a[b++]&63;g=224==(g&240)?(g&15)<<12|h<<6|k:(g&7)<<18|h<<12|k<<6|a[b++]&63;65536>g?e+=String.fromCharCode(g):(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|
16
+ g&1023))}}else e+=String.fromCharCode(g)}return e},ta=[0,31,60,91,121,152,182,213,244,274,305,335],ua=[0,31,59,90,120,151,181,212,243,273,304,334],M={},va=a=>{if(!(a instanceof ra||"unwind"==a))throw a;},N=0,wa=a=>{x=a;K||0<N||(c.onExit?.(a),w=!0);throw new ra(a);},xa=a=>{if(!w)try{if(a(),!(K||0<N))try{x=a=x,wa(a)}catch(b){va(b)}}catch(b){va(b)}},O;O=()=>performance.now();
17
+ var P=(a,b,d)=>{var e=A;if(!(0<d))return 0;var g=b;d=b+d-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var l=a.charCodeAt(++h);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(b>=d)break;e[b++]=k}else{if(2047>=k){if(b+1>=d)break;e[b++]=192|k>>6}else{if(65535>=k){if(b+2>=d)break;e[b++]=224|k>>12}else{if(b+3>=d)break;e[b++]=240|k>>18;e[b++]=128|k>>12&63}e[b++]=128|k>>6&63}e[b++]=128|k&63}}e[b]=0;return b-g},Q={},ya=()=>{if(!R){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",
18
+ PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:da||"./this.program"},b;for(b in Q)void 0===Q[b]?delete a[b]:a[b]=Q[b];var d=[];for(b in a)d.push(`${b}=${a[b]}`);R=d}return R},R,za=[null,[],[]],S=a=>{try{a()}catch(b){H(b)}};
19
+ function Aa(){var a=T,b={};for(let [d,e]of Object.entries(a))b[d]="function"==typeof e?(...g)=>{U.push(d);try{return e(...g)}finally{w||(U.pop(),V&&1===W&&0===U.length&&(W=0,S(Ba),"undefined"!=typeof Fibers&&Fibers.$a()))}}:e;return b}var W=0,X=81920,V=null,Ca=0,U=[],Da={},Ea={},Ga=0,Y=null,Ha=[];function Ia(){return new Promise((a,b)=>{Y={resolve:a,reject:b}})}
20
+ function Ja(){var a=Ka(12+X),b=a+12,d=X;C[a>>2]=b;C[a+4>>2]=b+d;b=U[0];d=Da[b];void 0===d&&(d=Ga++,Da[b]=d,Ea[d]=b);B[a+8>>2]=d;return a}
21
+ function La(a){if(!w){if(0===W){var b=!1,d=!1;a((e=0)=>{if(!w&&(Ca=e,b=!0,d)){W=2;S(()=>Ma(V));"undefined"!=typeof Browser&&Browser.Oa.Ya&&Browser.Oa.resume();e=!1;try{var g=(0,T[Ea[B[V+8>>2]]])()}catch(l){g=l,e=!0}var h=!1;if(!V){var k=Y;k&&(Y=null,(e?k.reject:k.resolve)(g),h=!0)}if(e&&!h)throw g;}});d=!0;b||(W=1,V=Ja(),"undefined"!=typeof Browser&&Browser.Oa.Ya&&Browser.Oa.pause(),S(()=>Na(V)))}else 2===W?(W=0,S(Oa),Pa(V),V=null,Ha.forEach(xa)):H(`invalid state: ${W}`);return Ca}}
22
+ var Qa=a=>{for(var b=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);127>=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++d):b+=3}return b},Ua=(a,b,d,e,g)=>{function h(n){--N;0!==u&&Ra(u);return"string"===b?n?L(A,n):"":"boolean"===b?!!n:n}var k={string:n=>{var y=0;if(null!==n&&void 0!==n&&0!==n){y=Qa(n)+1;var Fa=Sa(y);P(n,Fa,y);y=Fa}return y},array:n=>{var y=Sa(n.length);z.set(n,y);return y}};a=c["_"+a];var l=[],u=0;if(e)for(var q=0;q<e.length;q++){var E=k[d[q]];E?(0===u&&(u=Ta()),l[q]=E(e[q])):l[q]=e[q]}d=
23
+ V;e=a(...l);g=g?.async;N+=1;if(V!=d)return Ia().then(h);e=h(e);return g?Promise.resolve(e):e},Wa={b:(a,b,d,e)=>{H(`Assertion failed: ${a?L(A,a):""}, at: `+[b?b?L(A,b):"":"unknown filename",d,e?e?L(A,e):"":"unknown function"])},s:()=>{H("")},q:()=>1,n:()=>{K=!1;N=0},i:function(a,b,d){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));B[d>>2]=a.getSeconds();B[d+4>>2]=a.getMinutes();B[d+8>>2]=a.getHours();B[d+12>>2]=a.getDate();B[d+16>>2]=a.getMonth();B[d+20>>2]=a.getFullYear()-1900;
24
+ B[d+24>>2]=a.getDay();b=a.getFullYear();B[d+28>>2]=(0!==b%4||0===b%100&&0!==b%400?ua:ta)[a.getMonth()]+a.getDate()-1|0;B[d+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();B[d+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},l:(a,b)=>{M[a]&&(clearTimeout(M[a].id),delete M[a]);if(!b)return 0;var d=setTimeout(()=>{delete M[a];xa(()=>Va(a,O()))},b);M[a]={id:d,Za:b};return 0},o:(a,b,d,e)=>{var g=(new Date).getFullYear(),
25
+ h=(new Date(g,0,1)).getTimezoneOffset();g=(new Date(g,6,1)).getTimezoneOffset();C[a>>2]=60*Math.max(h,g);B[b>>2]=Number(h!=g);b=k=>{var l=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(l/60)).padStart(2,"0")}${String(l%60).padStart(2,"0")}`};a=b(h);b=b(g);g<h?(P(a,d,17),P(b,e,17)):(P(a,e,17),P(b,d,17))},r:()=>Date.now(),p:O,m:a=>{var b=A.length;a>>>=0;if(2147483648<a)return!1;for(var d=1;4>=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,
26
+ e)/65536))-p.buffer.byteLength+65535)/65536;try{p.grow(e);ha();var g=1;break a}catch(h){}g=void 0}if(g)return!0}return!1},e:(a,b)=>{var d=0;ya().forEach((e,g)=>{var h=b+d;g=C[a+4*g>>2]=h;for(h=0;h<e.length;++h)z[g++]=e.charCodeAt(h);z[g]=0;d+=e.length+1});return 0},f:(a,b)=>{var d=ya();C[a>>2]=d.length;var e=0;d.forEach(g=>e+=g.length+1);C[b>>2]=e;return 0},d:()=>52,k:function(){return 70},c:(a,b,d,e)=>{for(var g=0,h=0;h<d;h++){var k=C[b>>2],l=C[b+4>>2];b+=8;for(var u=0;u<l;u++){var q=A[k+u],E=za[a];
27
+ 0===q||10===q?((1===a?fa:t)(L(E,0)),E.length=0):E.push(q)}g+=l}C[e>>2]=g;return 0},a:p,t:wa,u:function(a,b,d,e,g){return c.callbacks.callFunction({handleSleep:La},a,b,d,e,g)},j:function(a){return c.callbacks.shouldInterrupt(void 0,a)},h:function(a,b,d){const e={handleSleep:La};d=d?L(A,d):"";return c.callbacks.loadModuleSource(e,a,b,d)},g:function(a,b,d,e){const g={handleSleep:La};d=d?L(A,d):"";e=e?L(A,e):"";return c.callbacks.normalizeModule(g,a,b,d,e)},v:function(a,b){X=a||b}},T=function(){function a(d){T=
28
+ d.exports;T=Aa();ja.unshift(T.w);D--;c.monitorRunDependencies?.(D);0==D&&(null!==F&&(clearInterval(F),F=null),G&&(d=G,G=null,d()));return T}var b={a:Wa};D++;c.monitorRunDependencies?.(D);if(c.instantiateWasm)try{return c.instantiateWasm(b,a)}catch(d){t(`Module.instantiateWasm callback failed with error: ${d}`),f(d)}I||=ma("emscripten-module.wasm")?"emscripten-module.wasm":c.locateFile?c.locateFile("emscripten-module.wasm",r):r+"emscripten-module.wasm";qa(b,function(d){a(d.instance)}).catch(f);return{}}(),
29
+ Ka=c._malloc=a=>(Ka=c._malloc=T.x)(a);c._QTS_Throw=(a,b)=>(c._QTS_Throw=T.y)(a,b);c._QTS_NewError=a=>(c._QTS_NewError=T.z)(a);c._QTS_RuntimeSetMemoryLimit=(a,b)=>(c._QTS_RuntimeSetMemoryLimit=T.A)(a,b);c._QTS_RuntimeComputeMemoryUsage=(a,b)=>(c._QTS_RuntimeComputeMemoryUsage=T.B)(a,b);c._QTS_RuntimeDumpMemoryUsage=a=>(c._QTS_RuntimeDumpMemoryUsage=T.C)(a);c._QTS_RecoverableLeakCheck=()=>(c._QTS_RecoverableLeakCheck=T.D)();c._QTS_BuildIsSanitizeLeak=()=>(c._QTS_BuildIsSanitizeLeak=T.E)();
30
+ c._QTS_RuntimeSetMaxStackSize=(a,b)=>(c._QTS_RuntimeSetMaxStackSize=T.F)(a,b);c._QTS_GetUndefined=()=>(c._QTS_GetUndefined=T.G)();c._QTS_GetNull=()=>(c._QTS_GetNull=T.H)();c._QTS_GetFalse=()=>(c._QTS_GetFalse=T.I)();c._QTS_GetTrue=()=>(c._QTS_GetTrue=T.J)();c._QTS_NewRuntime=()=>(c._QTS_NewRuntime=T.K)();c._QTS_FreeRuntime=a=>(c._QTS_FreeRuntime=T.L)(a);var Pa=c._free=a=>(Pa=c._free=T.M)(a);c._QTS_NewContext=(a,b)=>(c._QTS_NewContext=T.N)(a,b);c._QTS_FreeContext=a=>(c._QTS_FreeContext=T.O)(a);
31
+ c._QTS_FreeValuePointer=(a,b)=>(c._QTS_FreeValuePointer=T.P)(a,b);c._QTS_FreeValuePointerRuntime=(a,b)=>(c._QTS_FreeValuePointerRuntime=T.Q)(a,b);c._QTS_FreeVoidPointer=(a,b)=>(c._QTS_FreeVoidPointer=T.R)(a,b);c._QTS_FreeCString=(a,b)=>(c._QTS_FreeCString=T.S)(a,b);c._QTS_DupValuePointer=(a,b)=>(c._QTS_DupValuePointer=T.T)(a,b);c._QTS_NewObject=a=>(c._QTS_NewObject=T.U)(a);c._QTS_NewObjectProto=(a,b)=>(c._QTS_NewObjectProto=T.V)(a,b);c._QTS_NewArray=a=>(c._QTS_NewArray=T.W)(a);
32
+ c._QTS_NewArrayBuffer=(a,b,d)=>(c._QTS_NewArrayBuffer=T.X)(a,b,d);c._QTS_NewFloat64=(a,b)=>(c._QTS_NewFloat64=T.Y)(a,b);c._QTS_GetFloat64=(a,b)=>(c._QTS_GetFloat64=T.Z)(a,b);c._QTS_NewString=(a,b)=>(c._QTS_NewString=T._)(a,b);c._QTS_GetString=(a,b)=>(c._QTS_GetString=T.$)(a,b);c._QTS_GetArrayBuffer=(a,b)=>(c._QTS_GetArrayBuffer=T.aa)(a,b);c._QTS_GetArrayBufferLength=(a,b)=>(c._QTS_GetArrayBufferLength=T.ba)(a,b);c._QTS_NewSymbol=(a,b,d)=>(c._QTS_NewSymbol=T.ca)(a,b,d);
33
+ c._QTS_GetSymbolDescriptionOrKey=(a,b)=>(c._QTS_GetSymbolDescriptionOrKey=T.da)(a,b);c._QTS_IsGlobalSymbol=(a,b)=>(c._QTS_IsGlobalSymbol=T.ea)(a,b);c._QTS_IsJobPending=a=>(c._QTS_IsJobPending=T.fa)(a);c._QTS_ExecutePendingJob=(a,b,d)=>(c._QTS_ExecutePendingJob=T.ga)(a,b,d);c._QTS_GetProp=(a,b,d)=>(c._QTS_GetProp=T.ha)(a,b,d);c._QTS_GetPropNumber=(a,b,d)=>(c._QTS_GetPropNumber=T.ia)(a,b,d);c._QTS_SetProp=(a,b,d,e)=>(c._QTS_SetProp=T.ja)(a,b,d,e);
34
+ c._QTS_DefineProp=(a,b,d,e,g,h,k,l,u)=>(c._QTS_DefineProp=T.ka)(a,b,d,e,g,h,k,l,u);c._QTS_GetOwnPropertyNames=(a,b,d,e,g)=>(c._QTS_GetOwnPropertyNames=T.la)(a,b,d,e,g);c._QTS_Call=(a,b,d,e,g)=>(c._QTS_Call=T.ma)(a,b,d,e,g);c._QTS_ResolveException=(a,b)=>(c._QTS_ResolveException=T.na)(a,b);c._QTS_Dump=(a,b)=>(c._QTS_Dump=T.oa)(a,b);c._QTS_Eval=(a,b,d,e,g,h)=>(c._QTS_Eval=T.pa)(a,b,d,e,g,h);c._QTS_GetModuleNamespace=(a,b)=>(c._QTS_GetModuleNamespace=T.qa)(a,b);
35
+ c._QTS_Typeof=(a,b)=>(c._QTS_Typeof=T.ra)(a,b);c._QTS_GetLength=(a,b,d)=>(c._QTS_GetLength=T.sa)(a,b,d);c._QTS_IsEqual=(a,b,d,e)=>(c._QTS_IsEqual=T.ta)(a,b,d,e);c._QTS_GetGlobalObject=a=>(c._QTS_GetGlobalObject=T.ua)(a);c._QTS_NewPromiseCapability=(a,b)=>(c._QTS_NewPromiseCapability=T.va)(a,b);c._QTS_PromiseState=(a,b)=>(c._QTS_PromiseState=T.wa)(a,b);c._QTS_PromiseResult=(a,b)=>(c._QTS_PromiseResult=T.xa)(a,b);c._QTS_TestStringArg=a=>(c._QTS_TestStringArg=T.ya)(a);
36
+ c._QTS_GetDebugLogEnabled=a=>(c._QTS_GetDebugLogEnabled=T.za)(a);c._QTS_SetDebugLogEnabled=(a,b)=>(c._QTS_SetDebugLogEnabled=T.Aa)(a,b);c._QTS_BuildIsDebug=()=>(c._QTS_BuildIsDebug=T.Ba)();c._QTS_BuildIsAsyncify=()=>(c._QTS_BuildIsAsyncify=T.Ca)();c._QTS_NewFunction=(a,b,d)=>(c._QTS_NewFunction=T.Da)(a,b,d);c._QTS_ArgvGetJSValueConstPointer=(a,b)=>(c._QTS_ArgvGetJSValueConstPointer=T.Ea)(a,b);c._QTS_RuntimeEnableInterruptHandler=a=>(c._QTS_RuntimeEnableInterruptHandler=T.Fa)(a);
37
+ c._QTS_RuntimeDisableInterruptHandler=a=>(c._QTS_RuntimeDisableInterruptHandler=T.Ga)(a);c._QTS_RuntimeEnableModuleLoader=(a,b)=>(c._QTS_RuntimeEnableModuleLoader=T.Ha)(a,b);c._QTS_RuntimeDisableModuleLoader=a=>(c._QTS_RuntimeDisableModuleLoader=T.Ia)(a);c._QTS_bjson_encode=(a,b)=>(c._QTS_bjson_encode=T.Ja)(a,b);c._QTS_bjson_decode=(a,b)=>(c._QTS_bjson_decode=T.Ka)(a,b);c._QTS_EvalFunction=(a,b)=>(c._QTS_EvalFunction=T.La)(a,b);c._QTS_EncodeBytecode=(a,b)=>(c._QTS_EncodeBytecode=T.Ma)(a,b);
38
+ c._QTS_DecodeBytecode=(a,b)=>(c._QTS_DecodeBytecode=T.Na)(a,b);var Va=(a,b)=>(Va=T.Pa)(a,b),Ra=a=>(Ra=T.Qa)(a),Sa=a=>(Sa=T.Ra)(a),Ta=()=>(Ta=T.Sa)(),Na=a=>(Na=T.Ta)(a),Ba=()=>(Ba=T.Ua)(),Ma=a=>(Ma=T.Va)(a),Oa=()=>(Oa=T.Wa)();c.cwrap=(a,b,d,e)=>{var g=!d||d.every(h=>"number"===h||"boolean"===h);return"string"!==b&&g&&!e?c["_"+a]:(...h)=>Ua(a,b,d,h,e)};c.UTF8ToString=(a,b)=>a?L(A,a,b):"";c.stringToUTF8=(a,b,d)=>P(a,b,d);c.lengthBytesUTF8=Qa;var Z;G=function Xa(){Z||Ya();Z||(G=Xa)};
39
+ function Ya(){function a(){if(!Z&&(Z=!0,c.calledRun=!0,!w)){J(ja);aa(c);c.onRuntimeInitialized?.();if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;){var b=c.postRun.shift();ka.unshift(b)}J(ka)}}if(!(0<D)){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)la();J(ia);0<D||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1);a()},1)):a())}}
40
+ if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();Ya();moduleRtn=ba;
41
+
42
+
43
+ return moduleRtn;
44
+ }
45
+ );
46
+ })();
47
+ if (typeof exports === 'object' && typeof module === 'object')
48
+ module.exports = QuickJSRaw;
49
+ else if (typeof define === 'function' && define['amd'])
50
+ define([], () => QuickJSRaw);
@@ -0,0 +1,18 @@
1
+ // Generated from ../../templates/emscripten-module.ASYNCIFY.d.ts
2
+ import type {
3
+ EmscriptenModuleLoader,
4
+ QuickJSAsyncEmscriptenModule,
5
+ } from "@componentor/quickjs-ffi-types"
6
+ /**
7
+ * Emscripten module built from [`quickjs/quickjs.h`](../quickjs/quickjs.h) and
8
+ * our FFI support functions [c/interface.c](../c/interface.c), compiled with -s
9
+ * ASYNCIFY=1.
10
+ *
11
+ * Because this version is built with ASYNCIFY, the C code can call asynchronous
12
+ * Javascript functions as though they were synchronous.
13
+ *
14
+ * Note that emscripten modules returned by a `MODULARIZE=1` emscripten build
15
+ * (like this one) load asynchronously.
16
+ */
17
+ declare const ModuleLoader: EmscriptenModuleLoader<QuickJSAsyncEmscriptenModule>
18
+ export default ModuleLoader
@@ -0,0 +1,18 @@
1
+ // Generated from ../../templates/emscripten-module.ASYNCIFY.d.ts
2
+ import type {
3
+ EmscriptenModuleLoader,
4
+ QuickJSAsyncEmscriptenModule,
5
+ } from "@componentor/quickjs-ffi-types"
6
+ /**
7
+ * Emscripten module built from [`quickjs/quickjs.h`](../quickjs/quickjs.h) and
8
+ * our FFI support functions [c/interface.c](../c/interface.c), compiled with -s
9
+ * ASYNCIFY=1.
10
+ *
11
+ * Because this version is built with ASYNCIFY, the C code can call asynchronous
12
+ * Javascript functions as though they were synchronous.
13
+ *
14
+ * Note that emscripten modules returned by a `MODULARIZE=1` emscripten build
15
+ * (like this one) load asynchronously.
16
+ */
17
+ declare const ModuleLoader: EmscriptenModuleLoader<QuickJSAsyncEmscriptenModule>
18
+ export default ModuleLoader
@@ -0,0 +1,51 @@
1
+
2
+ var QuickJSRaw = (() => {
3
+ var _scriptName = import.meta.url;
4
+
5
+ return (
6
+ async function(moduleArg = {}) {
7
+ var moduleRtn;
8
+
9
+ var c=moduleArg,aa,f,ba=new Promise((a,b)=>{aa=a;f=b}),ca="object"==typeof window,m="function"==typeof importScripts,p="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(p){const {createRequire:a}=await import("module");var require=a(import.meta.url)}function q(a){a={log:a||function(){}};for(const b of q.Xa)b(a);return c.quickJSEmscriptenExtensions=a}q.Xa=[];c.quickjsEmscriptenInit=q;q.Xa.push(a=>{a.getWasmMemory=function(){return t}});
10
+ var da=Object.assign({},c),u="./this.program",w=(a,b)=>{throw b;},x="",z,A;
11
+ if(p){var fs=require("fs"),ea=require("path");x=require("url").fileURLToPath(new URL("./",import.meta.url));A=a=>{a=B(a)?new URL(a):ea.normalize(a);return fs.readFileSync(a)};z=a=>{a=B(a)?new URL(a):ea.normalize(a);return new Promise((b,d)=>{fs.readFile(a,void 0,(e,g)=>{e?d(e):b(g.buffer)})})};!c.thisProgram&&1<process.argv.length&&(u=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);w=(a,b)=>{process.exitCode=a;throw b;}}else if(ca||m)m?x=self.location.href:"undefined"!=typeof document&&
12
+ document.currentScript&&(x=document.currentScript.src),_scriptName&&(x=_scriptName),x.startsWith("blob:")?x="":x=x.substr(0,x.replace(/[?#].*/,"").lastIndexOf("/")+1),m&&(A=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),z=a=>B(a)?new Promise((b,d)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?b(e.response):d(e.status)};e.onerror=d;e.send(null)}):
13
+ fetch(a,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)));var fa=c.print||console.log.bind(console),C=c.printErr||console.error.bind(console);Object.assign(c,da);da=null;c.thisProgram&&(u=c.thisProgram);var D=c.wasmBinary,t,F=!1,G,H,I,J,K;
14
+ function ha(){var a=t.buffer;c.HEAP8=H=new Int8Array(a);c.HEAP16=new Int16Array(a);c.HEAPU8=I=new Uint8Array(a);c.HEAPU16=new Uint16Array(a);c.HEAP32=J=new Int32Array(a);c.HEAPU32=K=new Uint32Array(a);c.HEAPF32=new Float32Array(a);c.HEAPF64=new Float64Array(a)}c.wasmMemory?t=c.wasmMemory:t=new WebAssembly.Memory({initial:(c.INITIAL_MEMORY||16777216)/65536,maximum:32768});ha();var ia=[],ja=[],ka=[];function la(){var a=c.preRun.shift();ia.unshift(a)}var L=0,M=null,N=null;
15
+ function O(a){c.onAbort?.(a);a="Aborted("+a+")";C(a);F=!0;G=1;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");f(a);throw a;}var ma=a=>a.startsWith("data:application/octet-stream;base64,"),B=a=>a.startsWith("file://"),P;function na(a){if(a==P&&D)return new Uint8Array(D);if(A)return A(a);throw"both async and sync fetching of the wasm failed";}function oa(a){return D?Promise.resolve().then(()=>na(a)):z(a).then(b=>new Uint8Array(b),()=>na(a))}
16
+ function pa(a,b,d){return oa(a).then(e=>WebAssembly.instantiate(e,b)).then(d,e=>{C(`failed to asynchronously prepare wasm: ${e}`);O(e)})}function qa(a,b){var d=P;return D||"function"!=typeof WebAssembly.instantiateStreaming||ma(d)||B(d)||p||"function"!=typeof fetch?pa(d,a,b):fetch(d,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(b,function(g){C(`wasm streaming compile failed: ${g}`);C("falling back to ArrayBuffer instantiation");return pa(d,a,b)}))}
17
+ function ra(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}
18
+ var sa=a=>{for(;0<a.length;)a.shift()(c)},ta=c.noExitRuntime||!0,ua="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Q=(a,b,d)=>{var e=b+d;for(d=b;a[d]&&!(d>=e);)++d;if(16<d-b&&a.buffer&&ua)return ua.decode(a.subarray(b,d));for(e="";b<d;){var g=a[b++];if(g&128){var h=a[b++]&63;if(192==(g&224))e+=String.fromCharCode((g&31)<<6|h);else{var k=a[b++]&63;g=224==(g&240)?(g&15)<<12|h<<6|k:(g&7)<<18|h<<12|k<<6|a[b++]&63;65536>g?e+=String.fromCharCode(g):(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|
19
+ g&1023))}}else e+=String.fromCharCode(g)}return e},va=[0,31,60,91,121,152,182,213,244,274,305,335],wa=[0,31,59,90,120,151,181,212,243,273,304,334],R={},S=0,xa=a=>{G=a;ta||0<S||(c.onExit?.(a),F=!0);w(a,new ra(a))},ya=a=>{if(!F)try{if(a(),!(ta||0<S))try{G=a=G,xa(a)}catch(b){b instanceof ra||"unwind"==b||w(1,b)}}catch(b){b instanceof ra||"unwind"==b||w(1,b)}},za;za=()=>performance.now();
20
+ var T=(a,b,d)=>{var e=I;if(!(0<d))return 0;var g=b;d=b+d-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var l=a.charCodeAt(++h);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(b>=d)break;e[b++]=k}else{if(2047>=k){if(b+1>=d)break;e[b++]=192|k>>6}else{if(65535>=k){if(b+2>=d)break;e[b++]=224|k>>12}else{if(b+3>=d)break;e[b++]=240|k>>18;e[b++]=128|k>>12&63}e[b++]=128|k>>6&63}e[b++]=128|k&63}}e[b]=0;return b-g},Aa={},Ca=()=>{if(!Ba){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",
21
+ PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"},b;for(b in Aa)void 0===Aa[b]?delete a[b]:a[b]=Aa[b];var d=[];for(b in a)d.push(`${b}=${a[b]}`);Ba=d}return Ba},Ba,Da=[null,[],[]],U=a=>{try{a()}catch(b){O(b)}};
22
+ function Ea(){var a=V,b={};for(let [d,e]of Object.entries(a))b[d]="function"==typeof e?(...g)=>{W.push(d);try{return e(...g)}finally{F||(W.pop(),X&&1===Y&&0===W.length&&(Y=0,U(Fa),"undefined"!=typeof Fibers&&Fibers.$a()))}}:e;return b}var Y=0,Ga=81920,X=null,Ha=0,W=[],Ia={},Ja={},La=0,Ma=null,Na=[];function Oa(){return new Promise((a,b)=>{Ma={resolve:a,reject:b}})}
23
+ function Pa(){var a=Qa(12+Ga),b=a+12,d=Ga;K[a>>2]=b;K[a+4>>2]=b+d;b=W[0];d=Ia[b];void 0===d&&(d=La++,Ia[b]=d,Ja[d]=b);J[a+8>>2]=d;return a}
24
+ function Ra(a){if(!F){if(0===Y){var b=!1,d=!1;a((e=0)=>{if(!F&&(Ha=e,b=!0,d)){Y=2;U(()=>Sa(X));"undefined"!=typeof Browser&&Browser.Oa.Ya&&Browser.Oa.resume();e=!1;try{var g=(0,V[Ja[J[X+8>>2]]])()}catch(l){g=l,e=!0}var h=!1;if(!X){var k=Ma;k&&(Ma=null,(e?k.reject:k.resolve)(g),h=!0)}if(e&&!h)throw g;}});d=!0;b||(Y=1,X=Pa(),"undefined"!=typeof Browser&&Browser.Oa.Ya&&Browser.Oa.pause(),U(()=>Ta(X)))}else 2===Y?(Y=0,U(Ua),Va(X),X=null,Na.forEach(ya)):O(`invalid state: ${Y}`);return Ha}}
25
+ var Wa=a=>{for(var b=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);127>=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++d):b+=3}return b},$a=(a,b,d,e,g)=>{function h(n){--S;0!==v&&Xa(v);return"string"===b?n?Q(I,n):"":"boolean"===b?!!n:n}var k={string:n=>{var y=0;if(null!==n&&void 0!==n&&0!==n){y=Wa(n)+1;var Ka=Ya(y);T(n,Ka,y);y=Ka}return y},array:n=>{var y=Ya(n.length);H.set(n,y);return y}};a=c["_"+a];var l=[],v=0;if(e)for(var r=0;r<e.length;r++){var E=k[d[r]];E?(0===v&&(v=Za()),l[r]=E(e[r])):l[r]=e[r]}d=
26
+ X;e=a(...l);g=g?.async;S+=1;if(X!=d)return Oa().then(h);e=h(e);return g?Promise.resolve(e):e},bb={b:(a,b,d,e)=>{O(`Assertion failed: ${a?Q(I,a):""}, at: `+[b?b?Q(I,b):"":"unknown filename",d,e?e?Q(I,e):"":"unknown function"])},s:()=>{O("")},q:()=>1,n:()=>{ta=!1;S=0},i:function(a,b,d){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));J[d>>2]=a.getSeconds();J[d+4>>2]=a.getMinutes();J[d+8>>2]=a.getHours();J[d+12>>2]=a.getDate();J[d+16>>2]=a.getMonth();J[d+20>>2]=a.getFullYear()-1900;
27
+ J[d+24>>2]=a.getDay();b=a.getFullYear();J[d+28>>2]=(0!==b%4||0===b%100&&0!==b%400?wa:va)[a.getMonth()]+a.getDate()-1|0;J[d+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();J[d+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},l:(a,b)=>{R[a]&&(clearTimeout(R[a].id),delete R[a]);if(!b)return 0;var d=setTimeout(()=>{delete R[a];ya(()=>ab(a,za()))},b);R[a]={id:d,Za:b};return 0},o:(a,b,d,e)=>{var g=(new Date).getFullYear(),
28
+ h=(new Date(g,0,1)).getTimezoneOffset();g=(new Date(g,6,1)).getTimezoneOffset();K[a>>2]=60*Math.max(h,g);J[b>>2]=Number(h!=g);b=k=>{var l=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(l/60)).padStart(2,"0")}${String(l%60).padStart(2,"0")}`};a=b(h);b=b(g);g<h?(T(a,d,17),T(b,e,17)):(T(a,e,17),T(b,d,17))},r:()=>Date.now(),p:za,m:a=>{var b=I.length;a>>>=0;if(2147483648<a)return!1;for(var d=1;4>=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,
29
+ e)/65536))-t.buffer.byteLength+65535)/65536;try{t.grow(e);ha();var g=1;break a}catch(h){}g=void 0}if(g)return!0}return!1},e:(a,b)=>{var d=0;Ca().forEach((e,g)=>{var h=b+d;g=K[a+4*g>>2]=h;for(h=0;h<e.length;++h)H[g++]=e.charCodeAt(h);H[g]=0;d+=e.length+1});return 0},f:(a,b)=>{var d=Ca();K[a>>2]=d.length;var e=0;d.forEach(g=>e+=g.length+1);K[b>>2]=e;return 0},d:()=>52,k:function(){return 70},c:(a,b,d,e)=>{for(var g=0,h=0;h<d;h++){var k=K[b>>2],l=K[b+4>>2];b+=8;for(var v=0;v<l;v++){var r=I[k+v],E=Da[a];
30
+ 0===r||10===r?((1===a?fa:C)(Q(E,0)),E.length=0):E.push(r)}g+=l}K[e>>2]=g;return 0},a:t,t:xa,u:function(a,b,d,e,g){return c.callbacks.callFunction({handleSleep:Ra},a,b,d,e,g)},j:function(a){return c.callbacks.shouldInterrupt(void 0,a)},h:function(a,b,d){const e={handleSleep:Ra};d=d?Q(I,d):"";return c.callbacks.loadModuleSource(e,a,b,d)},g:function(a,b,d,e){const g={handleSleep:Ra};d=d?Q(I,d):"";e=e?Q(I,e):"";return c.callbacks.normalizeModule(g,a,b,d,e)},v:function(a,b){Ga=a||b}},V=function(){function a(d){V=
31
+ d.exports;V=Ea();ja.unshift(V.w);L--;c.monitorRunDependencies?.(L);0==L&&(null!==M&&(clearInterval(M),M=null),N&&(d=N,N=null,d()));return V}var b={a:bb};L++;c.monitorRunDependencies?.(L);if(c.instantiateWasm)try{return c.instantiateWasm(b,a)}catch(d){C(`Module.instantiateWasm callback failed with error: ${d}`),f(d)}P||=c.locateFile?ma("emscripten-module.wasm")?"emscripten-module.wasm":c.locateFile?c.locateFile("emscripten-module.wasm",x):x+"emscripten-module.wasm":(new URL("emscripten-module.wasm",
32
+ import.meta.url)).href;qa(b,function(d){a(d.instance)}).catch(f);return{}}(),Qa=c._malloc=a=>(Qa=c._malloc=V.x)(a);c._QTS_Throw=(a,b)=>(c._QTS_Throw=V.y)(a,b);c._QTS_NewError=a=>(c._QTS_NewError=V.z)(a);c._QTS_RuntimeSetMemoryLimit=(a,b)=>(c._QTS_RuntimeSetMemoryLimit=V.A)(a,b);c._QTS_RuntimeComputeMemoryUsage=(a,b)=>(c._QTS_RuntimeComputeMemoryUsage=V.B)(a,b);c._QTS_RuntimeDumpMemoryUsage=a=>(c._QTS_RuntimeDumpMemoryUsage=V.C)(a);
33
+ c._QTS_RecoverableLeakCheck=()=>(c._QTS_RecoverableLeakCheck=V.D)();c._QTS_BuildIsSanitizeLeak=()=>(c._QTS_BuildIsSanitizeLeak=V.E)();c._QTS_RuntimeSetMaxStackSize=(a,b)=>(c._QTS_RuntimeSetMaxStackSize=V.F)(a,b);c._QTS_GetUndefined=()=>(c._QTS_GetUndefined=V.G)();c._QTS_GetNull=()=>(c._QTS_GetNull=V.H)();c._QTS_GetFalse=()=>(c._QTS_GetFalse=V.I)();c._QTS_GetTrue=()=>(c._QTS_GetTrue=V.J)();c._QTS_NewRuntime=()=>(c._QTS_NewRuntime=V.K)();c._QTS_FreeRuntime=a=>(c._QTS_FreeRuntime=V.L)(a);
34
+ var Va=c._free=a=>(Va=c._free=V.M)(a);c._QTS_NewContext=(a,b)=>(c._QTS_NewContext=V.N)(a,b);c._QTS_FreeContext=a=>(c._QTS_FreeContext=V.O)(a);c._QTS_FreeValuePointer=(a,b)=>(c._QTS_FreeValuePointer=V.P)(a,b);c._QTS_FreeValuePointerRuntime=(a,b)=>(c._QTS_FreeValuePointerRuntime=V.Q)(a,b);c._QTS_FreeVoidPointer=(a,b)=>(c._QTS_FreeVoidPointer=V.R)(a,b);c._QTS_FreeCString=(a,b)=>(c._QTS_FreeCString=V.S)(a,b);c._QTS_DupValuePointer=(a,b)=>(c._QTS_DupValuePointer=V.T)(a,b);
35
+ c._QTS_NewObject=a=>(c._QTS_NewObject=V.U)(a);c._QTS_NewObjectProto=(a,b)=>(c._QTS_NewObjectProto=V.V)(a,b);c._QTS_NewArray=a=>(c._QTS_NewArray=V.W)(a);c._QTS_NewArrayBuffer=(a,b,d)=>(c._QTS_NewArrayBuffer=V.X)(a,b,d);c._QTS_NewFloat64=(a,b)=>(c._QTS_NewFloat64=V.Y)(a,b);c._QTS_GetFloat64=(a,b)=>(c._QTS_GetFloat64=V.Z)(a,b);c._QTS_NewString=(a,b)=>(c._QTS_NewString=V._)(a,b);c._QTS_GetString=(a,b)=>(c._QTS_GetString=V.$)(a,b);c._QTS_GetArrayBuffer=(a,b)=>(c._QTS_GetArrayBuffer=V.aa)(a,b);
36
+ c._QTS_GetArrayBufferLength=(a,b)=>(c._QTS_GetArrayBufferLength=V.ba)(a,b);c._QTS_NewSymbol=(a,b,d)=>(c._QTS_NewSymbol=V.ca)(a,b,d);c._QTS_GetSymbolDescriptionOrKey=(a,b)=>(c._QTS_GetSymbolDescriptionOrKey=V.da)(a,b);c._QTS_IsGlobalSymbol=(a,b)=>(c._QTS_IsGlobalSymbol=V.ea)(a,b);c._QTS_IsJobPending=a=>(c._QTS_IsJobPending=V.fa)(a);c._QTS_ExecutePendingJob=(a,b,d)=>(c._QTS_ExecutePendingJob=V.ga)(a,b,d);c._QTS_GetProp=(a,b,d)=>(c._QTS_GetProp=V.ha)(a,b,d);
37
+ c._QTS_GetPropNumber=(a,b,d)=>(c._QTS_GetPropNumber=V.ia)(a,b,d);c._QTS_SetProp=(a,b,d,e)=>(c._QTS_SetProp=V.ja)(a,b,d,e);c._QTS_DefineProp=(a,b,d,e,g,h,k,l,v)=>(c._QTS_DefineProp=V.ka)(a,b,d,e,g,h,k,l,v);c._QTS_GetOwnPropertyNames=(a,b,d,e,g)=>(c._QTS_GetOwnPropertyNames=V.la)(a,b,d,e,g);c._QTS_Call=(a,b,d,e,g)=>(c._QTS_Call=V.ma)(a,b,d,e,g);c._QTS_ResolveException=(a,b)=>(c._QTS_ResolveException=V.na)(a,b);c._QTS_Dump=(a,b)=>(c._QTS_Dump=V.oa)(a,b);
38
+ c._QTS_Eval=(a,b,d,e,g,h)=>(c._QTS_Eval=V.pa)(a,b,d,e,g,h);c._QTS_GetModuleNamespace=(a,b)=>(c._QTS_GetModuleNamespace=V.qa)(a,b);c._QTS_Typeof=(a,b)=>(c._QTS_Typeof=V.ra)(a,b);c._QTS_GetLength=(a,b,d)=>(c._QTS_GetLength=V.sa)(a,b,d);c._QTS_IsEqual=(a,b,d,e)=>(c._QTS_IsEqual=V.ta)(a,b,d,e);c._QTS_GetGlobalObject=a=>(c._QTS_GetGlobalObject=V.ua)(a);c._QTS_NewPromiseCapability=(a,b)=>(c._QTS_NewPromiseCapability=V.va)(a,b);c._QTS_PromiseState=(a,b)=>(c._QTS_PromiseState=V.wa)(a,b);
39
+ c._QTS_PromiseResult=(a,b)=>(c._QTS_PromiseResult=V.xa)(a,b);c._QTS_TestStringArg=a=>(c._QTS_TestStringArg=V.ya)(a);c._QTS_GetDebugLogEnabled=a=>(c._QTS_GetDebugLogEnabled=V.za)(a);c._QTS_SetDebugLogEnabled=(a,b)=>(c._QTS_SetDebugLogEnabled=V.Aa)(a,b);c._QTS_BuildIsDebug=()=>(c._QTS_BuildIsDebug=V.Ba)();c._QTS_BuildIsAsyncify=()=>(c._QTS_BuildIsAsyncify=V.Ca)();c._QTS_NewFunction=(a,b,d)=>(c._QTS_NewFunction=V.Da)(a,b,d);
40
+ c._QTS_ArgvGetJSValueConstPointer=(a,b)=>(c._QTS_ArgvGetJSValueConstPointer=V.Ea)(a,b);c._QTS_RuntimeEnableInterruptHandler=a=>(c._QTS_RuntimeEnableInterruptHandler=V.Fa)(a);c._QTS_RuntimeDisableInterruptHandler=a=>(c._QTS_RuntimeDisableInterruptHandler=V.Ga)(a);c._QTS_RuntimeEnableModuleLoader=(a,b)=>(c._QTS_RuntimeEnableModuleLoader=V.Ha)(a,b);c._QTS_RuntimeDisableModuleLoader=a=>(c._QTS_RuntimeDisableModuleLoader=V.Ia)(a);c._QTS_bjson_encode=(a,b)=>(c._QTS_bjson_encode=V.Ja)(a,b);
41
+ c._QTS_bjson_decode=(a,b)=>(c._QTS_bjson_decode=V.Ka)(a,b);c._QTS_EvalFunction=(a,b)=>(c._QTS_EvalFunction=V.La)(a,b);c._QTS_EncodeBytecode=(a,b)=>(c._QTS_EncodeBytecode=V.Ma)(a,b);c._QTS_DecodeBytecode=(a,b)=>(c._QTS_DecodeBytecode=V.Na)(a,b);var ab=(a,b)=>(ab=V.Pa)(a,b),Xa=a=>(Xa=V.Qa)(a),Ya=a=>(Ya=V.Ra)(a),Za=()=>(Za=V.Sa)(),Ta=a=>(Ta=V.Ta)(a),Fa=()=>(Fa=V.Ua)(),Sa=a=>(Sa=V.Va)(a),Ua=()=>(Ua=V.Wa)();
42
+ c.cwrap=(a,b,d,e)=>{var g=!d||d.every(h=>"number"===h||"boolean"===h);return"string"!==b&&g&&!e?c["_"+a]:(...h)=>$a(a,b,d,h,e)};c.UTF8ToString=(a,b)=>a?Q(I,a,b):"";c.stringToUTF8=(a,b,d)=>T(a,b,d);c.lengthBytesUTF8=Wa;var Z;N=function cb(){Z||db();Z||(N=cb)};
43
+ function db(){function a(){if(!Z&&(Z=!0,c.calledRun=!0,!F)){sa(ja);aa(c);c.onRuntimeInitialized?.();if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;){var b=c.postRun.shift();ka.unshift(b)}sa(ka)}}if(!(0<L)){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)la();sa(ia);0<L||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1);a()},1)):a())}}
44
+ if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();db();moduleRtn=ba;
45
+
46
+
47
+ return moduleRtn;
48
+ }
49
+ );
50
+ })();
51
+ export default QuickJSRaw;
Binary file
package/dist/ffi.d.mts ADDED
@@ -0,0 +1,96 @@
1
+ import { QuickJSAsyncEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@componentor/quickjs-ffi-types';
2
+
3
+ /**
4
+ * Low-level FFI bindings to QuickJS's Emscripten module.
5
+ * See instead {@link QuickJSContext}, the public Javascript interface exposed by this
6
+ * library.
7
+ *
8
+ * @unstable The FFI interface is considered private and may change.
9
+ */
10
+ declare class QuickJSAsyncFFI {
11
+ private module;
12
+ constructor(module: QuickJSAsyncEmscriptenModule);
13
+ /** Set at compile time. */
14
+ readonly DEBUG = false;
15
+ QTS_Throw: (ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer) => JSValuePointer;
16
+ QTS_NewError: (ctx: JSContextPointer) => JSValuePointer;
17
+ QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void;
18
+ QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer;
19
+ QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer;
20
+ QTS_RecoverableLeakCheck: () => number;
21
+ QTS_BuildIsSanitizeLeak: () => number;
22
+ QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void;
23
+ QTS_GetUndefined: () => JSValueConstPointer;
24
+ QTS_GetNull: () => JSValueConstPointer;
25
+ QTS_GetFalse: () => JSValueConstPointer;
26
+ QTS_GetTrue: () => JSValueConstPointer;
27
+ QTS_NewRuntime: () => JSRuntimePointer;
28
+ QTS_FreeRuntime: (rt: JSRuntimePointer) => void;
29
+ QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer;
30
+ QTS_FreeContext: (ctx: JSContextPointer) => void;
31
+ QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void;
32
+ QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void;
33
+ QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void;
34
+ QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void;
35
+ QTS_DupValuePointer: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
36
+ QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer;
37
+ QTS_NewObjectProto: (ctx: JSContextPointer, proto: JSValuePointer | JSValueConstPointer) => JSValuePointer;
38
+ QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer;
39
+ QTS_NewArrayBuffer: (ctx: JSContextPointer, buffer: JSVoidPointer, length: number) => JSValuePointer;
40
+ QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer;
41
+ QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
42
+ QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer;
43
+ QTS_GetString: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
44
+ QTS_GetArrayBuffer: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSVoidPointer;
45
+ QTS_GetArrayBufferLength: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => number;
46
+ QTS_NewSymbol: (ctx: JSContextPointer, description: BorrowedHeapCharPointer, isGlobal: number) => JSValuePointer;
47
+ QTS_GetSymbolDescriptionOrKey: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
48
+ QTS_GetSymbolDescriptionOrKey_MaybeAsync: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>;
49
+ QTS_IsGlobalSymbol: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
50
+ QTS_IsJobPending: (rt: JSRuntimePointer) => number;
51
+ QTS_ExecutePendingJob: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer;
52
+ QTS_ExecutePendingJob_MaybeAsync: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer | Promise<JSValuePointer>;
53
+ QTS_GetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer;
54
+ QTS_GetProp_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer | Promise<JSValuePointer>;
55
+ QTS_GetPropNumber: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer;
56
+ QTS_GetPropNumber_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer | Promise<JSValuePointer>;
57
+ QTS_SetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void;
58
+ QTS_SetProp_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void | Promise<void>;
59
+ QTS_DefineProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer, get: JSValuePointer | JSValueConstPointer, set: JSValuePointer | JSValueConstPointer, configurable: boolean, enumerable: boolean, has_value: boolean) => void;
60
+ QTS_GetOwnPropertyNames: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer;
61
+ QTS_GetOwnPropertyNames_MaybeAsync: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer | Promise<JSValuePointer>;
62
+ QTS_Call: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer;
63
+ QTS_Call_MaybeAsync: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer | Promise<JSValuePointer>;
64
+ QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer;
65
+ QTS_Dump: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
66
+ QTS_Dump_MaybeAsync: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>;
67
+ QTS_Eval: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer;
68
+ QTS_Eval_MaybeAsync: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer | Promise<JSValuePointer>;
69
+ QTS_GetModuleNamespace: (ctx: JSContextPointer, module_func_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
70
+ QTS_Typeof: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => OwnedHeapCharPointer;
71
+ QTS_GetLength: (ctx: JSContextPointer, out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer) => number;
72
+ QTS_IsEqual: (ctx: JSContextPointer, a: JSValuePointer | JSValueConstPointer, b: JSValuePointer | JSValueConstPointer, op: IsEqualOp) => number;
73
+ QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer;
74
+ QTS_NewPromiseCapability: (ctx: JSContextPointer, resolve_funcs_out: JSValuePointerPointer) => JSValuePointer;
75
+ QTS_PromiseState: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSPromiseStateEnum;
76
+ QTS_PromiseResult: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSValuePointer;
77
+ QTS_TestStringArg: (string: string) => void;
78
+ QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number;
79
+ QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void;
80
+ QTS_BuildIsDebug: () => number;
81
+ QTS_BuildIsAsyncify: () => number;
82
+ QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer;
83
+ QTS_ArgvGetJSValueConstPointer: (argv: JSValuePointer | JSValueConstPointer, index: number) => JSValueConstPointer;
84
+ QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void;
85
+ QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void;
86
+ QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void;
87
+ QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void;
88
+ QTS_bjson_encode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
89
+ QTS_bjson_decode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
90
+ QTS_EvalFunction: (ctx: JSContextPointer, fun_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
91
+ QTS_EvalFunction_MaybeAsync: (ctx: JSContextPointer, fun_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer | Promise<JSValuePointer>;
92
+ QTS_EncodeBytecode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
93
+ QTS_DecodeBytecode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
94
+ }
95
+
96
+ export { QuickJSAsyncFFI };
package/dist/ffi.d.ts ADDED
@@ -0,0 +1,96 @@
1
+ import { QuickJSAsyncEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@componentor/quickjs-ffi-types';
2
+
3
+ /**
4
+ * Low-level FFI bindings to QuickJS's Emscripten module.
5
+ * See instead {@link QuickJSContext}, the public Javascript interface exposed by this
6
+ * library.
7
+ *
8
+ * @unstable The FFI interface is considered private and may change.
9
+ */
10
+ declare class QuickJSAsyncFFI {
11
+ private module;
12
+ constructor(module: QuickJSAsyncEmscriptenModule);
13
+ /** Set at compile time. */
14
+ readonly DEBUG = false;
15
+ QTS_Throw: (ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer) => JSValuePointer;
16
+ QTS_NewError: (ctx: JSContextPointer) => JSValuePointer;
17
+ QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void;
18
+ QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer;
19
+ QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer;
20
+ QTS_RecoverableLeakCheck: () => number;
21
+ QTS_BuildIsSanitizeLeak: () => number;
22
+ QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void;
23
+ QTS_GetUndefined: () => JSValueConstPointer;
24
+ QTS_GetNull: () => JSValueConstPointer;
25
+ QTS_GetFalse: () => JSValueConstPointer;
26
+ QTS_GetTrue: () => JSValueConstPointer;
27
+ QTS_NewRuntime: () => JSRuntimePointer;
28
+ QTS_FreeRuntime: (rt: JSRuntimePointer) => void;
29
+ QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer;
30
+ QTS_FreeContext: (ctx: JSContextPointer) => void;
31
+ QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void;
32
+ QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void;
33
+ QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void;
34
+ QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void;
35
+ QTS_DupValuePointer: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
36
+ QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer;
37
+ QTS_NewObjectProto: (ctx: JSContextPointer, proto: JSValuePointer | JSValueConstPointer) => JSValuePointer;
38
+ QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer;
39
+ QTS_NewArrayBuffer: (ctx: JSContextPointer, buffer: JSVoidPointer, length: number) => JSValuePointer;
40
+ QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer;
41
+ QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
42
+ QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer;
43
+ QTS_GetString: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
44
+ QTS_GetArrayBuffer: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSVoidPointer;
45
+ QTS_GetArrayBufferLength: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => number;
46
+ QTS_NewSymbol: (ctx: JSContextPointer, description: BorrowedHeapCharPointer, isGlobal: number) => JSValuePointer;
47
+ QTS_GetSymbolDescriptionOrKey: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
48
+ QTS_GetSymbolDescriptionOrKey_MaybeAsync: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>;
49
+ QTS_IsGlobalSymbol: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
50
+ QTS_IsJobPending: (rt: JSRuntimePointer) => number;
51
+ QTS_ExecutePendingJob: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer;
52
+ QTS_ExecutePendingJob_MaybeAsync: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer | Promise<JSValuePointer>;
53
+ QTS_GetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer;
54
+ QTS_GetProp_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer | Promise<JSValuePointer>;
55
+ QTS_GetPropNumber: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer;
56
+ QTS_GetPropNumber_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer | Promise<JSValuePointer>;
57
+ QTS_SetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void;
58
+ QTS_SetProp_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void | Promise<void>;
59
+ QTS_DefineProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer, get: JSValuePointer | JSValueConstPointer, set: JSValuePointer | JSValueConstPointer, configurable: boolean, enumerable: boolean, has_value: boolean) => void;
60
+ QTS_GetOwnPropertyNames: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer;
61
+ QTS_GetOwnPropertyNames_MaybeAsync: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer | Promise<JSValuePointer>;
62
+ QTS_Call: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer;
63
+ QTS_Call_MaybeAsync: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer | Promise<JSValuePointer>;
64
+ QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer;
65
+ QTS_Dump: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
66
+ QTS_Dump_MaybeAsync: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>;
67
+ QTS_Eval: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer;
68
+ QTS_Eval_MaybeAsync: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer | Promise<JSValuePointer>;
69
+ QTS_GetModuleNamespace: (ctx: JSContextPointer, module_func_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
70
+ QTS_Typeof: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => OwnedHeapCharPointer;
71
+ QTS_GetLength: (ctx: JSContextPointer, out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer) => number;
72
+ QTS_IsEqual: (ctx: JSContextPointer, a: JSValuePointer | JSValueConstPointer, b: JSValuePointer | JSValueConstPointer, op: IsEqualOp) => number;
73
+ QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer;
74
+ QTS_NewPromiseCapability: (ctx: JSContextPointer, resolve_funcs_out: JSValuePointerPointer) => JSValuePointer;
75
+ QTS_PromiseState: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSPromiseStateEnum;
76
+ QTS_PromiseResult: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSValuePointer;
77
+ QTS_TestStringArg: (string: string) => void;
78
+ QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number;
79
+ QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void;
80
+ QTS_BuildIsDebug: () => number;
81
+ QTS_BuildIsAsyncify: () => number;
82
+ QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer;
83
+ QTS_ArgvGetJSValueConstPointer: (argv: JSValuePointer | JSValueConstPointer, index: number) => JSValueConstPointer;
84
+ QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void;
85
+ QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void;
86
+ QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void;
87
+ QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void;
88
+ QTS_bjson_encode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
89
+ QTS_bjson_decode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
90
+ QTS_EvalFunction: (ctx: JSContextPointer, fun_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
91
+ QTS_EvalFunction_MaybeAsync: (ctx: JSContextPointer, fun_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer | Promise<JSValuePointer>;
92
+ QTS_EncodeBytecode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
93
+ QTS_DecodeBytecode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
94
+ }
95
+
96
+ export { QuickJSAsyncFFI };
package/dist/ffi.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var ffi_exports={};__export(ffi_exports,{QuickJSAsyncFFI:()=>QuickJSAsyncFFI});module.exports=__toCommonJS(ffi_exports);var import_quickjs_ffi_types=require("@componentor/quickjs-ffi-types"),QuickJSAsyncFFI=class{constructor(module2){this.module=module2;this.DEBUG=!1;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","number","string"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"]);this.QTS_EvalFunction=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_EvalFunction","number",["number","number"]));this.QTS_EvalFunction_MaybeAsync=this.module.cwrap("QTS_EvalFunction","number",["number","number"]);this.QTS_EncodeBytecode=this.module.cwrap("QTS_EncodeBytecode","number",["number","number"]);this.QTS_DecodeBytecode=this.module.cwrap("QTS_DecodeBytecode","number",["number","number"])}};0&&(module.exports={QuickJSAsyncFFI});
2
+ //# sourceMappingURL=ffi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ffi.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSAsyncEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n assertSync,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSAsyncFFI {\n constructor(private module: QuickJSAsyncEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_GetSymbolDescriptionOrKey_MaybeAsync: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_GetSymbolDescriptionOrKey\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_ExecutePendingJob_MaybeAsync: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_ExecutePendingJob\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n )\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_GetProp\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetPropNumber_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = assertSync(\n this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_SetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void | Promise<void> = this.module.cwrap(\"QTS_SetProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_GetOwnPropertyNames_MaybeAsync: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetOwnPropertyNames\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n )\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_Call\", \"number\", [\"number\", \"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_Call_MaybeAsync: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_Dump_MaybeAsync: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_Dump\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_Eval_MaybeAsync: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_EvalFunction_MaybeAsync: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n"],"mappings":"wpBAAA,wHACA,6BA0BO,0CASM,gBAAN,KAAsB,CAC3B,YAAoBA,QAAsC,CAAtC,YAAAA,QAEpB,KAAS,MAAQ,GAEjB,eAGsB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,KAAK,OAAO,MAAM,iCAAkC,SAAU,CACvF,SACA,QACF,CAAC,EAED,uCAAoE,KAAK,OAAO,MAC9E,oCACA,KACA,CAAC,QAAQ,CACX,EAEA,wCAAqE,KAAK,OAAO,MAC/E,qCACA,KACA,CAAC,QAAQ,CACX,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE/E,oCAAiE,KAAK,OAAO,MAC3E,iCACA,KACA,CAAC,QAAQ,CACX,EAEA,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,yBAGsB,qCACpB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,CACtE,EAEA,iCAGgD,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAC9F,SACA,QACF,CAAC,EAED,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CA7fjC,CA8f7D","names":["module"]}
package/dist/ffi.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import{assertSync}from"@componentor/quickjs-ffi-types";var QuickJSAsyncFFI=class{constructor(module){this.module=module;this.DEBUG=!1;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=assertSync(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=assertSync(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=assertSync(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=assertSync(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=assertSync(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=assertSync(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=assertSync(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=assertSync(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=assertSync(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","number","string"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"]);this.QTS_EvalFunction=assertSync(this.module.cwrap("QTS_EvalFunction","number",["number","number"]));this.QTS_EvalFunction_MaybeAsync=this.module.cwrap("QTS_EvalFunction","number",["number","number"]);this.QTS_EncodeBytecode=this.module.cwrap("QTS_EncodeBytecode","number",["number","number"]);this.QTS_DecodeBytecode=this.module.cwrap("QTS_DecodeBytecode","number",["number","number"])}};export{QuickJSAsyncFFI};
2
+ //# sourceMappingURL=ffi.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ffi.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSAsyncEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n assertSync,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSAsyncFFI {\n constructor(private module: QuickJSAsyncEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_GetSymbolDescriptionOrKey_MaybeAsync: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_GetSymbolDescriptionOrKey\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_ExecutePendingJob_MaybeAsync: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_ExecutePendingJob\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n )\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_GetProp\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetPropNumber_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = assertSync(\n this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_SetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void | Promise<void> = this.module.cwrap(\"QTS_SetProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_GetOwnPropertyNames_MaybeAsync: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetOwnPropertyNames\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n )\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_Call\", \"number\", [\"number\", \"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_Call_MaybeAsync: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_Dump_MaybeAsync: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_Dump\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_Eval_MaybeAsync: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_EvalFunction_MaybeAsync: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n"],"mappings":"AACA,OAyBE,eACK,iCASA,IAAM,gBAAN,KAAsB,CAC3B,YAAoB,OAAsC,CAAtC,mBAEpB,KAAS,MAAQ,GAEjB,eAGsB,KAAK,OAAO,MAAM,YAAa,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,kBAA0D,KAAK,OAAO,MACpE,eACA,SACA,CAAC,QAAQ,CACX,EAEA,+BAA2E,KAAK,OAAO,MACrF,4BACA,KACA,CAAC,SAAU,QAAQ,CACrB,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,gCAA6E,KAAK,OAAO,MACvF,6BACA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ACX,EAEA,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,WACpB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,CACtE,EAEA,iCAGgD,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAC9F,SACA,QACF,CAAC,EAED,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CA7fjC,CA8f7D","names":[]}
@@ -0,0 +1,20 @@
1
+ import { QuickJSAsyncVariant } from '@componentor/quickjs-ffi-types';
2
+
3
+ /**
4
+ * ### @componentor/quickjs-ng-wasmfile-release-asyncify
5
+ *
6
+ * [Docs](https://github.com/componentor/quickjs-emscripten/blob/main/doc/@componentor/quickjs-ng-wasmfile-release-asyncify/README.md) |
7
+ * Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.
8
+ *
9
+ * | Variable | Setting | Description |
10
+ * | -- | -- | -- |
11
+ * | library | quickjs-ng | [quickjs-ng](https://github.com/quickjs-ng/quickjs) is a fork of quickjs that tends to add features more quickly. Version [git+7ded62c5](https://github.com/quickjs-ng/quickjs/commit/7ded62c536fca860b8106c39fb75f2df8fe27180) vendored to quickjs-emscripten on 2024-02-12. |
12
+ * | releaseMode | release | Optimized for performance; use when building/deploying your application. |
13
+ * | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
14
+ * | emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |
15
+ * | exports | require import browser workerd | Has these package.json export conditions |
16
+ *
17
+ */
18
+ declare const variant: QuickJSAsyncVariant;
19
+
20
+ export { variant as default };
@@ -0,0 +1,20 @@
1
+ import { QuickJSAsyncVariant } from '@componentor/quickjs-ffi-types';
2
+
3
+ /**
4
+ * ### @componentor/quickjs-ng-wasmfile-release-asyncify
5
+ *
6
+ * [Docs](https://github.com/componentor/quickjs-emscripten/blob/main/doc/@componentor/quickjs-ng-wasmfile-release-asyncify/README.md) |
7
+ * Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.
8
+ *
9
+ * | Variable | Setting | Description |
10
+ * | -- | -- | -- |
11
+ * | library | quickjs-ng | [quickjs-ng](https://github.com/quickjs-ng/quickjs) is a fork of quickjs that tends to add features more quickly. Version [git+7ded62c5](https://github.com/quickjs-ng/quickjs/commit/7ded62c536fca860b8106c39fb75f2df8fe27180) vendored to quickjs-emscripten on 2024-02-12. |
12
+ * | releaseMode | release | Optimized for performance; use when building/deploying your application. |
13
+ * | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
14
+ * | emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |
15
+ * | exports | require import browser workerd | Has these package.json export conditions |
16
+ *
17
+ */
18
+ declare const variant: QuickJSAsyncVariant;
19
+
20
+ export { variant as default };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var ffi_exports={};__export(ffi_exports,{QuickJSAsyncFFI:()=>QuickJSAsyncFFI});var import_quickjs_ffi_types,QuickJSAsyncFFI,init_ffi=__esm({"src/ffi.ts"(){"use strict";import_quickjs_ffi_types=require("@componentor/quickjs-ffi-types"),QuickJSAsyncFFI=class{constructor(module2){this.module=module2;this.DEBUG=!1;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","number","string"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"]);this.QTS_EvalFunction=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_EvalFunction","number",["number","number"]));this.QTS_EvalFunction_MaybeAsync=this.module.cwrap("QTS_EvalFunction","number",["number","number"]);this.QTS_EncodeBytecode=this.module.cwrap("QTS_EncodeBytecode","number",["number","number"]);this.QTS_DecodeBytecode=this.module.cwrap("QTS_DecodeBytecode","number",["number","number"])}}}});var index_exports={};__export(index_exports,{default:()=>index_default});module.exports=__toCommonJS(index_exports);var variant={type:"async",importFFI:()=>Promise.resolve().then(()=>(init_ffi(),ffi_exports)).then(mod=>mod.QuickJSAsyncFFI),importModuleLoader:()=>import("@componentor/quickjs-ng-wasmfile-release-asyncify/emscripten-module").then(mod=>mod.default)},index_default=variant;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ffi.ts","../src/index.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSAsyncEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n assertSync,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSAsyncFFI {\n constructor(private module: QuickJSAsyncEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_GetSymbolDescriptionOrKey_MaybeAsync: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_GetSymbolDescriptionOrKey\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_ExecutePendingJob_MaybeAsync: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_ExecutePendingJob\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n )\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_GetProp\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetPropNumber_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = assertSync(\n this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_SetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void | Promise<void> = this.module.cwrap(\"QTS_SetProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_GetOwnPropertyNames_MaybeAsync: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetOwnPropertyNames\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n )\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_Call\", \"number\", [\"number\", \"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_Call_MaybeAsync: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_Dump_MaybeAsync: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_Dump\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_Eval_MaybeAsync: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_EvalFunction_MaybeAsync: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n","import type { QuickJSAsyncVariant } from \"@componentor/quickjs-ffi-types\"\n\n/**\n * ### @componentor/quickjs-ng-wasmfile-release-asyncify\n *\n * [Docs](https://github.com/componentor/quickjs-emscripten/blob/main/doc/@componentor/quickjs-ng-wasmfile-release-asyncify/README.md) |\n * Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.\n *\n * | Variable | Setting | Description |\n * | -- | -- | -- |\n * | library | quickjs-ng | [quickjs-ng](https://github.com/quickjs-ng/quickjs) is a fork of quickjs that tends to add features more quickly. Version [git+7ded62c5](https://github.com/quickjs-ng/quickjs/commit/7ded62c536fca860b8106c39fb75f2df8fe27180) vendored to quickjs-emscripten on 2024-02-12. |\n * | releaseMode | release | Optimized for performance; use when building/deploying your application. |\n * | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |\n * | emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |\n * | exports | require import browser workerd | Has these package.json export conditions |\n *\n */\nconst variant: QuickJSAsyncVariant = {\n type: \"async\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSAsyncFFI),\n importModuleLoader: () =>\n import(\"@componentor/quickjs-ng-wasmfile-release-asyncify/emscripten-module\").then(\n (mod) => mod.default,\n ),\n} as const\n\nexport default variant\n"],"mappings":"q/BAAA,mFACA,yBAmCa,gBApCb,4CACA,yBA0BO,0CASM,gBAAN,KAAsB,CAC3B,YAAoBA,QAAsC,CAAtC,YAAAA,QAEpB,KAAS,MAAQ,GAEjB,eAGsB,KAAK,OAAO,MAAM,YAAa,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,kBAA0D,KAAK,OAAO,MACpE,eACA,SACA,CAAC,QAAQ,CACX,EAEA,+BAA2E,KAAK,OAAO,MACrF,4BACA,KACA,CAAC,SAAU,QAAQ,CACrB,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,gCAA6E,KAAK,OAAO,MACvF,6BACA,SACA,CAAC,QAAQ,CACX,EAEA,8BAAyC,KAAK,OAAO,MACnD,2BACA,SACA,CAAC,CACH,EAEA,6BAAwC,KAAK,OAAO,MAAM,0BAA2B,SAAU,CAAC,CAAC,EAEjG,gCACE,KAAK,OAAO,MAAM,6BAA8B,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE5E,sBAA8C,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,CAAC,EAEhG,iBAAyC,KAAK,OAAO,MAAM,cAAe,SAAU,CAAC,CAAC,EAEtF,kBAA0C,KAAK,OAAO,MAAM,eAAgB,SAAU,CAAC,CAAC,EAExF,iBAAyC,KAAK,OAAO,MAAM,cAAe,SAAU,CAAC,CAAC,EAEtF,oBAAyC,KAAK,OAAO,MAAM,iBAAkB,SAAU,CAAC,CAAC,EAEzF,qBAAkD,KAAK,OAAO,MAAM,kBAAmB,KAAM,CAC3F,QACF,CAAC,EAED,oBACE,KAAK,OAAO,MAAM,iBAAkB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEpE,qBAAmD,KAAK,OAAO,MAAM,kBAAmB,KAAM,C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@@ -0,0 +1,2 @@
1
+ var variant={type:"async",importFFI:()=>import("./ffi.mjs").then(mod=>mod.QuickJSAsyncFFI),importModuleLoader:()=>import("@componentor/quickjs-ng-wasmfile-release-asyncify/emscripten-module").then(mod=>mod.default)},index_default=variant;export{index_default as default};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { QuickJSAsyncVariant } from \"@componentor/quickjs-ffi-types\"\n\n/**\n * ### @componentor/quickjs-ng-wasmfile-release-asyncify\n *\n * [Docs](https://github.com/componentor/quickjs-emscripten/blob/main/doc/@componentor/quickjs-ng-wasmfile-release-asyncify/README.md) |\n * Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.\n *\n * | Variable | Setting | Description |\n * | -- | -- | -- |\n * | library | quickjs-ng | [quickjs-ng](https://github.com/quickjs-ng/quickjs) is a fork of quickjs that tends to add features more quickly. Version [git+7ded62c5](https://github.com/quickjs-ng/quickjs/commit/7ded62c536fca860b8106c39fb75f2df8fe27180) vendored to quickjs-emscripten on 2024-02-12. |\n * | releaseMode | release | Optimized for performance; use when building/deploying your application. |\n * | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |\n * | emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |\n * | exports | require import browser workerd | Has these package.json export conditions |\n *\n */\nconst variant: QuickJSAsyncVariant = {\n type: \"async\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSAsyncFFI),\n importModuleLoader: () =>\n import(\"@componentor/quickjs-ng-wasmfile-release-asyncify/emscripten-module\").then(\n (mod) => mod.default,\n ),\n} as const\n\nexport default variant\n"],"mappings":"AAiBA,IAAM,QAA+B,CACnC,KAAM,QACN,UAAW,IAAM,OAAO,WAAU,EAAE,KAAM,KAAQ,IAAI,eAAe,EACrE,mBAAoB,IAClB,OAAO,qEAAqE,EAAE,KAC3E,KAAQ,IAAI,OACf,CACJ,EAEO,cAAQ","names":[]}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@componentor/quickjs-ng-wasmfile-release-asyncify",
3
+ "license": "MIT",
4
+ "version": "0.31.0",
5
+ "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.",
6
+ "sideEffects": false,
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/componentor/quickjs-emscripten"
10
+ },
11
+ "author": {
12
+ "name": "Componentor"
13
+ },
14
+ "files": [
15
+ "LICENSE",
16
+ "README.md",
17
+ "dist/**/*",
18
+ "!dist/*.tsbuildinfo"
19
+ ],
20
+ "types": "./dist/index.d.ts",
21
+ "main": "./dist/index.js",
22
+ "module": "./dist/index.mjs",
23
+ "browser": "./dist/index.mjs",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.mjs",
28
+ "require": "./dist/index.js",
29
+ "default": "./dist/index.js"
30
+ },
31
+ "./package.json": "./package.json",
32
+ "./ffi": {
33
+ "types": "./dist/ffi.d.ts",
34
+ "import": "./dist/ffi.mjs",
35
+ "require": "./dist/ffi.js",
36
+ "default": "./dist/ffi.js"
37
+ },
38
+ "./wasm": "./dist/emscripten-module.wasm",
39
+ "./emscripten-module": {
40
+ "types": "./dist/emscripten-module.browser.d.ts",
41
+ "iife": "./dist/emscripten-module.cjs",
42
+ "workerd": "./dist/emscripten-module.cloudflare.cjs",
43
+ "browser": "./dist/emscripten-module.browser.mjs",
44
+ "import": "./dist/emscripten-module.mjs",
45
+ "require": "./dist/emscripten-module.cjs",
46
+ "default": "./dist/emscripten-module.cjs"
47
+ }
48
+ },
49
+ "dependencies": {
50
+ "@componentor/quickjs-ffi-types": "0.31.0"
51
+ },
52
+ "devDependencies": {
53
+ "@jitl/tsconfig": "0.31.0"
54
+ },
55
+ "scripts": {
56
+ "build": "pnpm run build:c && pnpm run build:ts",
57
+ "build:c": "make",
58
+ "build:ts": "npx tsup",
59
+ "check:types": "npx tsc --project . --noEmit",
60
+ "clean": "make clean"
61
+ }
62
+ }