aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets
diff options
context:
space:
mode:
author蒼時弦也 <[email protected]>2020-10-09 23:16:54 +0800
committerRon Evans <[email protected]>2020-10-18 22:15:47 +0200
commite690ff0d8c3d42437e5b740a20d0544240c70ade (patch)
tree3999d67009655f5c583a27402b250799ea456c24 /targets
parent06564cbdb2ec19d4cce496d263e8d33dbd94f340 (diff)
downloadtinygo-e690ff0d8c3d42437e5b740a20d0544240c70ade.tar.gz
tinygo-e690ff0d8c3d42437e5b740a20d0544240c70ade.zip
Add instanceof support for WebAssembly
Diffstat (limited to 'targets')
-rw-r--r--targets/wasm_exec.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js
index 746b4c91c..a0dd10a1e 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) => {