LibJS: Distinguish between omitted descriptor attributes and false ones

When calling Object.defineProperty, there is now a difference between
omitting a descriptor attribute and specifying that it is false. For
example, "{}" and "{ configurable: false }" will have different
attribute values.
This commit is contained in:
Matthew Olsson 2020-06-02 17:13:09 -07:00 committed by Andreas Kling
commit 5ad5322f6a
Notes: sideshowbarker 2024-07-19 05:47:47 +09:00
8 changed files with 186 additions and 83 deletions

View file

@ -1304,7 +1304,7 @@ Value ObjectExpression::execute(Interpreter& interpreter) const
auto& obj_to_spread = key_result.as_object();
for (auto& it : obj_to_spread.shape().property_table_ordered()) {
if (it.value.attributes & Attribute::Enumerable)
if (it.value.attributes.is_enumerable())
object->define_property(it.key, obj_to_spread.get(it.key));
}
} else if (key_result.is_string()) {