1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +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:
Linus Groh 2021-11-14 12:21:48 +00:00
parent 57de5056b6
commit 27d84bebd4

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>