WebContent+LibWeb+LibJS: Report exceptions to the JS console

Print exceptions passed to `HTML::report_exception` in the JS console

Refactored `ExceptionReporter`: in order to report exception now
you need to pass the relevant realm in it. For passed `JS::Value`
we now create `JS::Error` object to print value as the error message.
This commit is contained in:
Pavel 2022-10-08 19:38:32 +04:00 committed by Linus Groh
commit 40aad77ab1
Notes: sideshowbarker 2024-07-17 05:47:05 +09:00
14 changed files with 86 additions and 58 deletions

View file

@ -1139,7 +1139,7 @@ JS::Value Document::run_javascript(StringView source, StringView filename)
if (result.is_error()) {
// FIXME: I'm sure the spec could tell us something about error propagation here!
HTML::report_exception(result);
HTML::report_exception(result, realm());
return {};
}