js-wasm-cycle.js (474B)
1 function f() { 2 return 42; 3 } 4 export { f }; 5 6 import { mem, tab, glob, func } from "./js-wasm-cycle.wasm"; 7 assert_false(glob instanceof WebAssembly.Global, "imported global should be unwrapped in ESM integration"); 8 assert_equals(glob, 1, "unwrapped global should have direct value"); 9 assert_true(mem instanceof WebAssembly.Memory); 10 assert_true(tab instanceof WebAssembly.Table); 11 assert_true(func instanceof Function); 12 13 f = () => { 14 return 24; 15 }; 16 17 assert_equals(func(), 42);