mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibJS: Fix ProxyObject get/set with symbol property name
We can't assume that property names can be converted to strings anymore, as we have symbols. Use name.to_value() instead. This makes something like this possible: new Proxy(Object, { get(t, p) { return t[p] } })[Symbol.hasInstance]
This commit is contained in:
parent
44e38b8457
commit
2cf8649d0e
Notes:
sideshowbarker
2024-07-19 01:33:04 +09:00
Author: https://github.com/linusg
Commit: 2cf8649d0e
Pull-request: https://github.com/SerenityOS/serenity/pull/3949
Issue: https://github.com/SerenityOS/serenity/issues/3947
3 changed files with 8 additions and 5 deletions
|
@ -38,6 +38,7 @@ describe("[[Get]] trap normal behavior", () => {
|
|||
expect(p.baz).toBe(3);
|
||||
expect(p.qux).toBe(3);
|
||||
expect(p.test).toBeUndefined();
|
||||
expect(p[Symbol.hasInstance]).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue