mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +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:
parent
58ab76269c
commit
e5da1cc566
13 changed files with 32 additions and 29 deletions
|
@ -115,7 +115,7 @@ Object* Value::to_object(Heap& heap) const
|
|||
return heap.allocate<BooleanObject>(m_value.as_bool);
|
||||
|
||||
if (is_null() || is_undefined()) {
|
||||
heap.interpreter().throw_exception<Error>("TypeError", "ToObject on null or undefined.");
|
||||
heap.interpreter().throw_exception<TypeError>("ToObject on null or undefined.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue