LibJS: Remove redundant exception checks from initialize_constructor()

define_direct_property() simply wraps storage_set(), which cannot throw.
This commit is contained in:
Linus Groh 2021-11-14 12:21:48 +00:00
commit 27d84bebd4
Notes: sideshowbarker 2024-07-18 01:09:29 +09:00

View file

@ -138,13 +138,8 @@ inline void GlobalObject::initialize_constructor(PropertyKey const& property_nam
auto& vm = this->vm();
constructor = heap().allocate<ConstructorType>(*this, *this);
constructor->define_direct_property(vm.names.name, js_string(heap(), property_name.as_string()), Attribute::Configurable);
if (vm.exception())
return;
if (prototype) {
if (prototype)
prototype->define_direct_property(vm.names.constructor, constructor, Attribute::Writable | Attribute::Configurable);
if (vm.exception())
return;
}
}
template<typename ConstructorType>