Skip to content

Commit 91563cf

Browse files
dgryskiaykevl
authored andcommitted
targets/wasm_exec: call process.exit() when go.run() returns
1 parent 4f96a50 commit 91563cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

targets/wasm_exec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,10 @@
531531

532532
const go = new Go();
533533
WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {
534-
return go.run(result.instance);
534+
go.run(result.instance).then((result) => {
535+
process.exit(result);
536+
}).
537+
catch((e) => { throw e });
535538
}).catch((err) => {
536539
console.error(err);
537540
process.exit(1);

0 commit comments

Comments
 (0)