]> Cypherpunks repositories - gostls13.git/commitdiff
misc/wasm: handle error during instantiateStreaming
authorAgniva De Sarker <agnivade@yahoo.co.in>
Mon, 3 Sep 2018 06:32:25 +0000 (12:02 +0530)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 4 Sep 2018 07:02:45 +0000 (07:02 +0000)
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>

misc/wasm/wasm_exec.html

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