Commit 9eef9648 authored by Richard Musiol's avatar Richard Musiol Committed by Richard Musiol

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent fb9b818b
...@@ -477,7 +477,7 @@ ...@@ -477,7 +477,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);
} }
...@@ -495,7 +495,8 @@ ...@@ -495,7 +495,8 @@
}); });
return go.run(result.instance); return go.run(result.instance);
}).catch((err) => { }).catch((err) => {
throw err; console.error(err);
process.exit(1);
}); });
} }
})(); })();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment