aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets
diff options
context:
space:
mode:
authorElliott Sales de Andrade <[email protected]>2020-03-26 04:16:14 -0400
committerRon Evans <[email protected]>2020-04-13 08:47:34 +0200
commit4347496623913eb072f6f9d09a512b134d99d83f (patch)
tree087c8d08c7f0ef4ea84c3f6d5b269e339c03d763 /targets
parent9c78f7039debcbadf3968d902e144ac8953a5dd6 (diff)
downloadtinygo-4347496623913eb072f6f9d09a512b134d99d83f.tar.gz
tinygo-4347496623913eb072f6f9d09a512b134d99d83f.zip
wasm_exec: Cross-port exit with code 1 change.
This cross-ports the following commit: https://github.com/golang/go/commit/9eef9648005c17681800fdb55ed2404ab769761e
Diffstat (limited to 'targets')
-rw-r--r--targets/wasm_exec.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js
index 4c8790667..50381fa92 100644
--- a/targets/wasm_exec.js
+++ b/targets/wasm_exec.js
@@ -479,7 +479,7 @@
!global.process.versions.electron
) {
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);
}
@@ -487,7 +487,8 @@
WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {
return go.run(result.instance);
}).catch((err) => {
- throw err;
+ console.error(err);
+ process.exit(1);
});
}
})();