mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Use specific error classes when throwing exceptions
Generally: - interpreter.throw_exception<JS::Error>("TypeError", "Message"); + interpreter.throw_exception<JS::TypeError>("Message");
This commit is contained in:
parent
ad230e8839
commit
62d0fa5af8
Notes:
sideshowbarker
2024-07-19 07:39:52 +09:00
Author: https://github.com/linusg
Commit: 62d0fa5af8
Pull-request: https://github.com/SerenityOS/serenity/pull/1769
3 changed files with 6 additions and 6 deletions
|
@ -64,7 +64,7 @@ static Document* document_from(JS::Interpreter& interpreter)
|
|||
if (!this_object)
|
||||
return {};
|
||||
if (StringView("DocumentWrapper") != this_object->class_name()) {
|
||||
interpreter.throw_exception<JS::Error>("TypeError", "That's not a DocumentWrapper, bro.");
|
||||
interpreter.throw_exception<JS::TypeError>("That's not a DocumentWrapper, bro.");
|
||||
return {};
|
||||
}
|
||||
return &static_cast<DocumentWrapper*>(this_object)->node();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue