mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +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:
parent
c52739ea4b
commit
48369194d2
4 changed files with 32 additions and 18 deletions
|
@ -93,4 +93,10 @@ describe("normal behavior", () => {
|
|||
expect(foo.setPropCalled).toBeTrue();
|
||||
expect(bar.setPropCalled).toBeTrue();
|
||||
});
|
||||
|
||||
test("native setter function", () => {
|
||||
const e = new Error();
|
||||
Reflect.set(Error.prototype, "name", "Foo", e);
|
||||
expect(e.name).toBe("Foo");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue