diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.h b/Userland/Libraries/LibJS/Runtime/GlobalObject.h index f2da91e32c..ec95be6bc5 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.h @@ -138,13 +138,8 @@ inline void GlobalObject::initialize_constructor(PropertyKey const& property_nam auto& vm = this->vm(); constructor = heap().allocate(*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