1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibJS: Throw real TypeError, ReferenceError, etc objects

Instead of just throwing Error objects with a name string, we now throw
the real Error subclass types. :^)
This commit is contained in:
Andreas Kling 2020-04-10 12:48:31 +02:00
parent 58ab76269c
commit e5da1cc566
13 changed files with 32 additions and 29 deletions

View file

@ -110,7 +110,7 @@ void Object::put_own_property(Object& this_object, const FlyString& property_nam
if (mode == PutOwnPropertyMode::DefineProperty && !(metadata.value().attributes & Attribute::Configurable) && attributes != metadata.value().attributes) {
dbg() << "Disallow reconfig of non-configurable property";
interpreter().throw_exception<Error>("TypeError", String::format("Cannot redefine property '%s'", property_name.characters()));
interpreter().throw_exception<TypeError>(String::format("Cannot redefine property '%s'", property_name.characters()));
return;
}