mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
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:
parent
033057683c
commit
fac82119df
Notes:
sideshowbarker
2024-07-17 23:00:03 +09:00
Author: https://github.com/caitp Commit: https://github.com/LadybirdBrowser/ladybird/commit/fac82119df Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/550 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 1 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue