mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
LibJS: Add property configuration transitions
Object.defineProperty() can now change the attributes of a property already on the object. Internally this becomes a shape transition with the TransitionType::Configure. Such transitions don't expand the property storage capacity, but rather simply keep attributes up to date when generating a property table.
This commit is contained in:
@@ -33,6 +33,14 @@ try {
|
||||
assert(e.name === "TypeError");
|
||||
}
|
||||
|
||||
Object.defineProperty(o, "baz", { value: 9, configurable: true, writable: false });
|
||||
Object.defineProperty(o, "baz", { configurable: true, writable: true });
|
||||
|
||||
d = Object.getOwnPropertyDescriptor(o, "baz");
|
||||
assert(d.configurable === true);
|
||||
assert(d.writable === true);
|
||||
assert(d.value === 9);
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
|
||||
Reference in New Issue
Block a user