Skip to content

Commit 4347496

Browse files
QuLogicdeadprogram
authored andcommitted
wasm_exec: Cross-port exit with code 1 change.
This cross-ports the following commit: golang/go@9eef964
1 parent 9c78f70 commit 4347496

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

targets/wasm_exec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,15 +479,16 @@
479479
!global.process.versions.electron
480480
) {
481481
if (process.argv.length != 3) {
482-
process.stderr.write("usage: go_js_wasm_exec [wasm binary] [arguments]\n");
482+
console.error("usage: go_js_wasm_exec [wasm binary] [arguments]");
483483
process.exit(1);
484484
}
485485

486486
const go = new Go();
487487
WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {
488488
return go.run(result.instance);
489489
}).catch((err) => {
490-
throw err;
490+
console.error(err);
491+
process.exit(1);
491492
});
492493
}
493494
})();

0 commit comments

Comments
 (0)