wasm_exec: Cross-port exit with code 1 change.

This cross-ports the following commit:
https://github.com/golang/go/commit/9eef9648005c17681800fdb55ed2404ab769761e
This commit is contained in:
Elliott Sales de Andrade
2020-03-26 04:16:14 -04:00
committed by Ron Evans
parent 9c78f7039d
commit 4347496623
+3 -2
View File
@@ -479,7 +479,7 @@
!global.process.versions.electron !global.process.versions.electron
) { ) {
if (process.argv.length != 3) { if (process.argv.length != 3) {
process.stderr.write("usage: go_js_wasm_exec [wasm binary] [arguments]\n"); console.error("usage: go_js_wasm_exec [wasm binary] [arguments]");
process.exit(1); process.exit(1);
} }
@@ -487,7 +487,8 @@
WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => { WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {
return go.run(result.instance); return go.run(result.instance);
}).catch((err) => { }).catch((err) => {
throw err; console.error(err);
process.exit(1);
}); });
} }
})(); })();