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

LibJS: Forward receiver value to native property getters/setters

There's no reason why only (user-defined) accessors would have set the
receiver as this value for their getters/setters, this is an oversight.
This commit is contained in:
Linus Groh 2020-11-22 17:29:25 +00:00 committed by Andreas Kling
parent c52739ea4b
commit 48369194d2
4 changed files with 32 additions and 18 deletions

View file

@ -60,4 +60,8 @@ describe("normal behavior", () => {
expect(foo.getPropCalled).toBeTrue();
expect(bar.getPropCalled).toBeTrue();
});
test("native getter function", () => {
expect(Reflect.get(String.prototype, "length", "foo")).toBe(3);
});
});