summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/ObjectConstructor.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-09 22:55:17 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-10 00:36:06 +0200
commit8286f8b996be00b1a2c60dae4ceb870da0328dd9 (patch)
tree8ab1997148e5907beef324ee81ba3912d678846f /Libraries/LibJS/Runtime/ObjectConstructor.cpp
parente6d920d87ddd7b02b4fbbca3d6d6e98b9c8107dd (diff)
downloadserenity-8286f8b996be00b1a2c60dae4ceb870da0328dd9.zip
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.
Diffstat (limited to 'Libraries/LibJS/Runtime/ObjectConstructor.cpp')
-rw-r--r--Libraries/LibJS/Runtime/ObjectConstructor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Libraries/LibJS/Runtime/ObjectConstructor.cpp
index 5d3b54fdfb..0ed34c26b5 100644
--- a/Libraries/LibJS/Runtime/ObjectConstructor.cpp
+++ b/Libraries/LibJS/Runtime/ObjectConstructor.cpp
@@ -127,7 +127,7 @@ Value ObjectConstructor::define_property(Interpreter& interpreter)
auto& object = interpreter.argument(0).as_object();
auto& descriptor = interpreter.argument(2).as_object();
- Value value = descriptor.get("value").value_or(js_undefined());
+ Value value = descriptor.get("value").value_or(Value());
u8 configurable = descriptor.get("configurable").value_or(Value(false)).to_boolean() * Attribute::Configurable;
u8 enumerable = descriptor.get("enumerable").value_or(Value(false)).to_boolean() * Attribute::Enumerable;
u8 writable = descriptor.get("writable").value_or(Value(false)).to_boolean() * Attribute::Writable;