mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 15:44:45 +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:
@@ -70,7 +70,7 @@ Value ScriptFunction::length_getter(Interpreter& interpreter)
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_function())
|
||||
return interpreter.throw_exception<Error>("TypeError", "Not a function");
|
||||
return interpreter.throw_exception<TypeError>("Not a function");
|
||||
return Value(static_cast<i32>(static_cast<const ScriptFunction*>(this_object)->parameters().size()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user