Browse Source

wasm_exec: Implement syscall/js.valueDelete.

This is only useful on Go 1.14, and is a port of:
60f271358f
pull/1052/head
Elliott Sales de Andrade 5 years ago
committed by Ron Evans
parent
commit
471cb4cfd7
  1. 7
      targets/wasm_exec.js

7
targets/wasm_exec.js

@ -318,6 +318,13 @@
Reflect.set(v, p, x);
},
// func valueDelete(v ref, p string)
"syscall/js.valueDelete": (v_addr, p_ptr, p_len) => {
const v = loadValue(v_addr);
const p = loadString(p_ptr, p_len);
Reflect.deleteProperty(v, p);
},
// func valueIndex(v ref, i int) ref
"syscall/js.valueIndex": (ret_addr, v_addr, i) => {
storeValue(ret_addr, Reflect.get(loadValue(v_addr), i));

Loading…
Cancel
Save