aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets/wasm_exec.js
diff options
context:
space:
mode:
Diffstat (limited to 'targets/wasm_exec.js')
-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);