1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

LibJS: Add interpreter exception checks

This commit is contained in:
Matthew Olsson 2020-06-07 10:53:14 -07:00 committed by Andreas Kling
parent f306ddb78b
commit 4e33fbdb67
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);
}