diff options
Diffstat (limited to 'cli/tests/051_wasm_import/wasm-dep.js')
-rw-r--r-- | cli/tests/051_wasm_import/wasm-dep.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cli/tests/051_wasm_import/wasm-dep.js b/cli/tests/051_wasm_import/wasm-dep.js new file mode 100644 index 000000000..70b16348b --- /dev/null +++ b/cli/tests/051_wasm_import/wasm-dep.js @@ -0,0 +1,17 @@ +function assertEquals(actual, expected, msg) { + if (actual !== expected) { + throw new Error(msg || ""); + } +} + +export function jsFn() { + state = "WASM JS Function Executed"; + return 42; +} + +export let state = "JS Function Executed"; + +export function jsInitFn() { + assertEquals(state, "JS Function Executed", "Incorrect state"); + state = "WASM Start Executed"; +} |