1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:17:35 +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:
Linus Groh 2020-11-04 21:55:15 +00:00 committed by Andreas Kling
parent 44e38b8457
commit 2cf8649d0e
3 changed files with 8 additions and 5 deletions

View file

@ -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();
});
});