diff options
author | Damian Gryski <[email protected]> | 2024-11-13 13:44:31 -0800 |
---|---|---|
committer | Ayke <[email protected]> | 2024-11-14 09:16:25 +0100 |
commit | 91563cff1f91efd58671f7b8b4d9880424071c4a (patch) | |
tree | 4ae8a1ca2c6cddbee75f73ccc58a1d5d8b662e7d | |
parent | 4f96a50fd0ba05f186403f8bcbf8e8871dcc2534 (diff) | |
download | tinygo-91563cff1f91efd58671f7b8b4d9880424071c4a.tar.gz tinygo-91563cff1f91efd58671f7b8b4d9880424071c4a.zip |
targets/wasm_exec: call process.exit() when go.run() returns
-rw-r--r-- | targets/wasm_exec.js | 5 |
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); |