js: Implement Value.instanceOf method which performs Js' `instanceof`
check
This commit is contained in:
parent
c587350c71
commit
3b00b478ce
2 changed files with 12 additions and 0 deletions
|
|
@ -276,6 +276,13 @@ const zig = {
|
|||
return val_js === other_js;
|
||||
},
|
||||
|
||||
zigValueInstanceOf(val, other) {
|
||||
let memory = new MemoryBlock(zig.wasm.exports.memory.buffer);
|
||||
const val_js = zig.readObject(memory.slice(val), memory);
|
||||
const other_js = zig.readObject(memory.slice(other), memory);
|
||||
return val_js instanceof other_js;
|
||||
},
|
||||
|
||||
functionCall(func, this_param, args, args_len, ret_ptr) {
|
||||
let memory = new MemoryBlock(zig.wasm.exports.memory.buffer);
|
||||
let argv = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue