1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibJS: Use a custom property_name_to_value method instead of to_value

This commit is contained in:
davidot 2021-07-05 01:59:50 +02:00 committed by Linus Groh
parent 721238f41c
commit ce59e49e27
7 changed files with 104 additions and 6 deletions

View file

@ -24,6 +24,18 @@ describe("[Call][GetOwnProperty]] trap normal behavior", () => {
Object.getOwnPropertyDescriptor(p, "foo");
});
test("correct arguments passed to trap even for number", () => {
let o = {};
let p = new Proxy(o, {
getOwnPropertyDescriptor(target, property) {
expect(target).toBe(o);
expect(property).toBe("1");
},
});
Object.getOwnPropertyDescriptor(p, 1);
});
test("conditional returned descriptor", () => {
let o = { foo: "bar" };
Object.defineProperty(o, "baz", {