From e690ff0d8c3d42437e5b740a20d0544240c70ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=BC=E6=99=82=E5=BC=A6=E4=B9=9F?= Date: Fri, 9 Oct 2020 23:16:54 +0800 Subject: [PATCH] Add instanceof support for WebAssembly --- targets/wasm_exec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js index 746b4c91..a0dd10a1 100644 --- a/targets/wasm_exec.js +++ b/targets/wasm_exec.js @@ -407,9 +407,9 @@ }, // func valueInstanceOf(v ref, t ref) bool - //"syscall/js.valueInstanceOf": (sp) => { - // mem().setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16)); - //}, + "syscall/js.valueInstanceOf": (v_addr, t_addr) => { + return loadValue(v_attr) instanceof loadValue(t_addr); + }, // func copyBytesToGo(dst []byte, src ref) (int, bool) "syscall/js.copyBytesToGo": (ret_addr, dest_addr, dest_len, dest_cap, source_addr) => {