diff options
author | Richard Musiol <mail@richard-musiol.de> | 2019-03-24 18:17:43 +0100 |
---|---|---|
committer | Richard Musiol <neelance@gmail.com> | 2019-03-25 07:55:12 +0000 |
commit | 9eef9648005c17681800fdb55ed2404ab769761e (patch) | |
tree | a4165185863f77e5e0e18e34e940a6ade962d2cf /misc/wasm | |
parent | fb9b818bbd2273579ea09f71017ee42bbc91a3b3 (diff) | |
download | go-9eef9648005c17681800fdb55ed2404ab769761e.tar.gz go-9eef9648005c17681800fdb55ed2404ab769761e.zip |
misc/wasm: exit with code 1 if WebAssembly.instantiate fails
go_js_wasm_exec was returning with code 0 if WebAssembly.instantiate
failed. This made failing tests show as passed.
Change-Id: Icfb2f42e9f1c3c70ca4a130a61a63cb305edff32
Reviewed-on: https://go-review.googlesource.com/c/go/+/168885
Run-TryBot: Richard Musiol <neelance@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'misc/wasm')
-rw-r--r-- | misc/wasm/wasm_exec.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js index e939e8527a..29427d91e5 100644 --- a/misc/wasm/wasm_exec.js +++ b/misc/wasm/wasm_exec.js @@ -477,7 +477,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); } @@ -495,7 +495,8 @@ }); return go.run(result.instance); }).catch((err) => { - throw err; + console.error(err); + process.exit(1); }); } })(); |