LibWeb: Legacy Platform Objects don't force [[Configurable]]

Per https://github.com/whatwg/webidl/commit/3fb6ab4dbc6a42517c84acf0909,
this step in the spec didn't reflect the reality in mainstream browsers.
This change fixes a failure in WPT/dom/collections/
This commit is contained in:
Caitlin Potter 2024-07-10 08:51:56 -04:00 committed by Andrew Kaster
parent 033057683c
commit fac82119df
Notes: sideshowbarker 2024-07-17 23:00:03 +09:00

View file

@ -320,15 +320,7 @@ JS::ThrowCompletionOr<bool> PlatformObject::internal_define_own_property(JS::Pro
}
}
// 3. If O does not implement an interface with the [Global] extended attribute, then set Desc.[[Configurable]] to true.
// 4. Return ! OrdinaryDefineOwnProperty(O, P, Desc).
if (!m_legacy_platform_object_flags->has_global_interface_extended_attribute) {
// property_descriptor is a const&, thus we need to create a copy here to set [[Configurable]]
JS::PropertyDescriptor descriptor_copy(property_descriptor);
descriptor_copy.configurable = true;
return Object::internal_define_own_property(property_name, descriptor_copy);
}
// 3. Return ! OrdinaryDefineOwnProperty(O, P, Desc).
return Object::internal_define_own_property(property_name, property_descriptor);
}