mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 03:53:42 +00:00
wasm_exec: Implement syscall/js.valueDelete.
This is only useful on Go 1.14, and is a port of: https://github.com/golang/go/commit/60f271358f07647be0de9ee8225b50a391ea5def
This commit is contained in:
committed by
Ron Evans
parent
5706b062e9
commit
471cb4cfd7
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user