mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 09:51:33 +00:00
Fix imported memory fallback and add common stdlib imports to loader
This commit is contained in:
@ -60,3 +60,7 @@ export const varadd_ptr = varadd;
|
||||
export function calladd(fn: (a: i32, b: i32) => i32, a: i32, b: i32): i32 {
|
||||
return fn(a, b);
|
||||
}
|
||||
|
||||
export function dotrace(num: f64): void {
|
||||
trace("The answer is", 1, num);
|
||||
}
|
||||
|
Binary file not shown.
@ -59,3 +59,6 @@ assert.strictEqual(fn(2), 4);
|
||||
// should be able to create a new function and call it from WASM
|
||||
ptr = module.newFunction(module.varadd);
|
||||
assert.strictEqual(module.calladd(ptr, 2, 3), 5);
|
||||
|
||||
// should be able to use trace
|
||||
module.dotrace(42);
|
||||
|
Reference in New Issue
Block a user