mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
LibJS: Remove redundant exception checks from initialize_constructor()
define_direct_property() simply wraps storage_set(), which cannot throw.
This commit is contained in:
parent
57de5056b6
commit
27d84bebd4
1 changed files with 1 additions and 6 deletions
|
@ -138,13 +138,8 @@ inline void GlobalObject::initialize_constructor(PropertyKey const& property_nam
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
constructor = heap().allocate<ConstructorType>(*this, *this);
|
constructor = heap().allocate<ConstructorType>(*this, *this);
|
||||||
constructor->define_direct_property(vm.names.name, js_string(heap(), property_name.as_string()), Attribute::Configurable);
|
constructor->define_direct_property(vm.names.name, js_string(heap(), property_name.as_string()), Attribute::Configurable);
|
||||||
if (vm.exception())
|
if (prototype)
|
||||||
return;
|
|
||||||
if (prototype) {
|
|
||||||
prototype->define_direct_property(vm.names.constructor, constructor, Attribute::Writable | Attribute::Configurable);
|
prototype->define_direct_property(vm.names.constructor, constructor, Attribute::Writable | Attribute::Configurable);
|
||||||
if (vm.exception())
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ConstructorType>
|
template<typename ConstructorType>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue