aboutsummaryrefslogtreecommitdiff
path: root/misc/wasm/wasm_exec.js
diff options
context:
space:
mode:
Diffstat (limited to 'misc/wasm/wasm_exec.js')
-rw-r--r--misc/wasm/wasm_exec.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js
index 3ea03c45b7..82041e6bb9 100644
--- a/misc/wasm/wasm_exec.js
+++ b/misc/wasm/wasm_exec.js
@@ -503,6 +503,9 @@
}
async run(instance) {
+ if (!(instance instanceof WebAssembly.Instance)) {
+ throw new Error("Go.run: WebAssembly.Instance expected");
+ }
this._inst = instance;
this.mem = new DataView(this._inst.exports.mem.buffer);
this._values = [ // JS values that Go currently has references to, indexed by reference id