misc/wasm: handle error during instantiateStreaming

The same catch block is there in wasm_exec.js for node processes.
Added it in browser invocations too, to prevent uncaught exceptions.

Change-Id: Icab577ec585fa86df3c76db508b49401bcdb52ae
Reviewed-on: https://go-review.googlesource.com/132916
Reviewed-by: Richard Musiol <neelance@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Agniva De Sarker 2018-09-03 12:02:25 +05:30 committed by Brad Fitzpatrick
parent db3f52db8e
commit e2e44a5d16
1 changed files with 2 additions and 0 deletions

View File

@ -27,6 +27,8 @@ license that can be found in the LICENSE file.
mod = result.module; mod = result.module;
inst = result.instance; inst = result.instance;
document.getElementById("runButton").disabled = false; document.getElementById("runButton").disabled = false;
}).catch((err) => {
console.error(err);
}); });
async function run() { async function run() {