mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Support passing more parameter types to HTML::report_exception()
We now allow any JS::ThrowCompletion<T>, as well as JS::Completion directly (although we'll VERIFY() that it's a throw completion.)
This commit is contained in:
committed by
Linus Groh
parent
3383ae1598
commit
4db5406d62
Notes:
sideshowbarker
2024-07-17 19:09:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4db5406d62 Pull-request: https://github.com/SerenityOS/serenity/pull/12308 Reviewed-by: https://github.com/Lubrsi Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg ✅
@@ -10,6 +10,13 @@
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
void report_exception(JS::ThrowCompletionOr<JS::Value> const& value);
|
||||
void report_exception(JS::Completion const&);
|
||||
|
||||
template<typename T>
|
||||
inline void report_exception(JS::ThrowCompletionOr<T> const& result)
|
||||
{
|
||||
VERIFY(result.is_throw_completion());
|
||||
report_exception(result.throw_completion());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user