1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibJS: Allow no-op define property calls on non-configurable objects

This brings us slightly closer to the specification's 10.1.6.3
ValidateAndApplyPropertyDescriptor.
This commit is contained in:
Idan Horowitz 2021-06-16 13:07:16 +03:00 committed by Linus Groh
parent 0c8dce60a2
commit c619ad4fec
2 changed files with 31 additions and 8 deletions

View file

@ -166,7 +166,7 @@ describe("errors", () => {
Object.defineProperty(o, "foo", { value: 1, writable: true, enumerable: true });
expect(() => {
Object.defineProperty(o, "foo", { value: 2, writable: false, enumerable: true });
Object.defineProperty(o, "foo", { value: 2, writable: true, enumerable: false });
}).toThrowWithMessage(
TypeError,
"Cannot change attributes of non-configurable property 'foo'"
@ -179,7 +179,7 @@ describe("errors", () => {
Object.defineProperty(o, s, { value: 1, writable: true, enumerable: true });
expect(() => {
Object.defineProperty(o, s, { value: 2, writable: false, enumerable: true });
Object.defineProperty(o, s, { value: 2, writable: true, enumerable: false });
}).toThrowWithMessage(
TypeError,
"Cannot change attributes of non-configurable property 'Symbol(foo)'"