1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 21:58:10 +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:
Andreas Kling 2020-04-09 22:55:17 +02:00
parent e6d920d87d
commit 8286f8b996
5 changed files with 57 additions and 8 deletions

View file

@ -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)