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:
parent
0c8dce60a2
commit
c619ad4fec
2 changed files with 31 additions and 8 deletions
|
@ -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)'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue