LibJS: Add interpreter exception checks

This commit is contained in:
Matthew Olsson 2020-06-07 10:53:14 -07:00 committed by Andreas Kling
commit 4e33fbdb67
Notes: sideshowbarker 2024-07-19 05:45:16 +09:00
11 changed files with 137 additions and 36 deletions

View file

@ -74,7 +74,11 @@ inline void GlobalObject::add_constructor(const FlyString& property_name, Constr
{
constructor = heap().allocate<ConstructorType>();
constructor->define_property("name", js_string(heap(), property_name), Attribute::Configurable);
if (interpreter().exception())
return;
prototype.define_property("constructor", constructor, Attribute::Writable | Attribute::Configurable);
if (interpreter().exception())
return;
define_property(property_name, constructor, Attribute::Writable | Attribute::Configurable);
}