aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-11-14 09:21:30 +0100
committerDamian Gryski <[email protected]>2024-11-14 11:02:54 -0800
commit258dac23247209dc54a2a986da9205549600d487 (patch)
treebf2ce8d16c931e4b1a3169e11fba137ea5d59530
parentb7d91e2f33c12f3a17ca36173dab789d80c63d26 (diff)
downloadtinygo-258dac23247209dc54a2a986da9205549600d487.tar.gz
tinygo-258dac23247209dc54a2a986da9205549600d487.zip
wasm: tidy up wasm_exec.js a bit
-rw-r--r--targets/wasm_exec.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js
index 41ccaed12..defc73ba8 100644
--- a/targets/wasm_exec.js
+++ b/targets/wasm_exec.js
@@ -530,11 +530,9 @@
}
const go = new Go();
- WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {
- go.run(result.instance).then((result) => {
- process.exit(result);
- }).
- catch((e) => { throw e });
+ WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then(async (result) => {
+ let exitCode = await go.run(result.instance);
+ process.exit(exitCode);
}).catch((err) => {
console.error(err);
process.exit(1);