mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
LibJS: Throw when delete-ing a non-configurable property in strict mode
This commit is contained in:
parent
c619ad4fec
commit
07992c8da6
1 changed files with 4 additions and 1 deletions
|
@ -781,8 +781,11 @@ bool Object::delete_property(const PropertyName& property_name)
|
|||
auto metadata = shape().lookup(property_name.to_string_or_symbol());
|
||||
if (!metadata.has_value())
|
||||
return true;
|
||||
if (!metadata.value().attributes.is_configurable())
|
||||
if (!metadata.value().attributes.is_configurable()) {
|
||||
if (vm().in_strict_mode())
|
||||
vm().throw_exception<TypeError>(global_object(), ErrorType::DescChangeNonConfigurable, property_name.to_string_or_symbol().to_display_string());
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t deleted_offset = metadata.value().offset;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue