diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-11-14 05:31:39 -0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-14 08:31:39 -0500 |
commit | 4189cc1ab5493ab0aef48c06416c4d16f6806245 (patch) | |
tree | dad82896518ed93548a8d11b7bf68ad6a0eaa4f0 /cli/tests/051_wasm_import/wasm-dep.js | |
parent | fdf0ede2acd110ba04857d5674db19c908b3ff32 (diff) |
Loader: support .wasm imports (#3328)
* loader: support .wasm imports
* http_server: true
* Support named exports
* Clippy
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"; +} |