aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets/wasm_exec.js
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2024-11-13 13:44:31 -0800
committerAyke <[email protected]>2024-11-14 09:16:25 +0100
commit91563cff1f91efd58671f7b8b4d9880424071c4a (patch)
tree4ae8a1ca2c6cddbee75f73ccc58a1d5d8b662e7d /targets/wasm_exec.js
parent4f96a50fd0ba05f186403f8bcbf8e8871dcc2534 (diff)
downloadtinygo-91563cff1f91efd58671f7b8b4d9880424071c4a.tar.gz
tinygo-91563cff1f91efd58671f7b8b4d9880424071c4a.zip
targets/wasm_exec: call process.exit() when go.run() returns
Diffstat (limited to 'targets/wasm_exec.js')
-rw-r--r--targets/wasm_exec.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js
index d6270adbf..41ccaed12 100644
--- a/targets/wasm_exec.js
+++ b/targets/wasm_exec.js
@@ -531,7 +531,10 @@
const go = new Go();
WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {
- return go.run(result.instance);
+ go.run(result.instance).then((result) => {
+ process.exit(result);
+ }).
+ catch((e) => { throw e });
}).catch((err) => {
console.error(err);
process.exit(1);