@raviqqe/stak 0.2.0 → 0.2.2
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/package.json +1 -1
- package/stak_wasm.d.ts +6 -0
- package/stak_wasm.js +31 -0
- package/stak_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/stak_wasm.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export function compile(source: string): Uint8Array;
|
|
|
12
12
|
* @returns {Uint8Array}
|
|
13
13
|
*/
|
|
14
14
|
export function interpret(bytecodes: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* @param {Uint8Array} bytecodes
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
export function decode(bytecodes: Uint8Array): string;
|
|
15
20
|
|
|
16
21
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
17
22
|
|
|
@@ -19,6 +24,7 @@ export interface InitOutput {
|
|
|
19
24
|
readonly memory: WebAssembly.Memory;
|
|
20
25
|
readonly compile: (a: number, b: number, c: number) => void;
|
|
21
26
|
readonly interpret: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
27
|
+
readonly decode: (a: number, b: number, c: number) => void;
|
|
22
28
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
23
29
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
24
30
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
package/stak_wasm.js
CHANGED
|
@@ -176,6 +176,37 @@ export function interpret(bytecodes, input, heap_size) {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
/**
|
|
180
|
+
* @param {Uint8Array} bytecodes
|
|
181
|
+
* @returns {string}
|
|
182
|
+
*/
|
|
183
|
+
export function decode(bytecodes) {
|
|
184
|
+
let deferred3_0;
|
|
185
|
+
let deferred3_1;
|
|
186
|
+
try {
|
|
187
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
188
|
+
const ptr0 = passArray8ToWasm0(bytecodes, wasm.__wbindgen_malloc);
|
|
189
|
+
const len0 = WASM_VECTOR_LEN;
|
|
190
|
+
wasm.decode(retptr, ptr0, len0);
|
|
191
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
192
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
193
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
194
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
195
|
+
var ptr2 = r0;
|
|
196
|
+
var len2 = r1;
|
|
197
|
+
if (r3) {
|
|
198
|
+
ptr2 = 0; len2 = 0;
|
|
199
|
+
throw takeObject(r2);
|
|
200
|
+
}
|
|
201
|
+
deferred3_0 = ptr2;
|
|
202
|
+
deferred3_1 = len2;
|
|
203
|
+
return getStringFromWasm0(ptr2, len2);
|
|
204
|
+
} finally {
|
|
205
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
206
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
179
210
|
async function __wbg_load(module, imports) {
|
|
180
211
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
181
212
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
package/stak_wasm_bg.wasm
CHANGED
|
Binary file
|