mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-30 14:20:21 +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
Notes:
sideshowbarker
2024-07-18 01:09:29 +09:00
Author: https://github.com/linusg
Commit: 27d84bebd4
Pull-request: https://github.com/SerenityOS/serenity/pull/10917
Reviewed-by: https://github.com/IdanHo ✅
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();
|
||||
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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue