mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
LibJS: Use a custom property_name_to_value method instead of to_value
This commit is contained in:
parent
721238f41c
commit
ce59e49e27
7 changed files with 104 additions and 6 deletions
|
@ -18,6 +18,19 @@ describe("[[Has]] trap normal behavior", () => {
|
|||
"foo" in p;
|
||||
});
|
||||
|
||||
test("correct arguments passed to trap even for number", () => {
|
||||
let o = {};
|
||||
let p = new Proxy(o, {
|
||||
has(target, prop) {
|
||||
expect(target).toBe(o);
|
||||
expect(prop).toBe("1");
|
||||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
1 in p;
|
||||
});
|
||||
|
||||
test("conditional return", () => {
|
||||
let o = {};
|
||||
let p = new Proxy(o, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue