diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-getOwnPropertyDescriptor.js')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-getOwnPropertyDescriptor.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-getOwnPropertyDescriptor.js b/Userland/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-getOwnPropertyDescriptor.js index 9b9addf14a..60fb2303a8 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-getOwnPropertyDescriptor.js +++ b/Userland/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-getOwnPropertyDescriptor.js @@ -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", { |