From 41e093d7bbeb8ba2cf4bb36d3e566afcb6562d27 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 21 Jan 2019 14:49:16 +0100 Subject: [PATCH] wasm: switch emulator to node.js Unfortunately, the olin/cwa emulator does not handle floats correctly. Node.js does, and because it is also supported by the Go WebAssembly implementation it has better support in general. --- targets/wasm.json | 2 +- targets/wasm_exec.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/targets/wasm.json b/targets/wasm.json index d7eab5a5..7a497ccc 100644 --- a/targets/wasm.json +++ b/targets/wasm.json @@ -12,5 +12,5 @@ "ldflags": [ "-allow-undefined" ], - "emulator": ["cwa"] + "emulator": ["node", "targets/wasm_exec.js"] } diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js index 2f7b3d23..0fc92305 100644 --- a/targets/wasm_exec.js +++ b/targets/wasm_exec.js @@ -427,7 +427,6 @@ if (code === 0 && !go.exited) { // deadlock, make Go print error and stack traces go._callbackShutdown = true; - go._inst.exports.run(); } }); return go.run(result.instance);