mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
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:
Notes:
sideshowbarker
2024-07-17 05:47:05 +09:00
Author: https://github.com/wentwrong 🔰 Commit: https://github.com/SerenityOS/serenity/commit/40aad77ab1 Pull-request: https://github.com/SerenityOS/serenity/pull/15517 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg
@@ -202,7 +202,7 @@ JS::VM& main_thread_vm()
|
||||
|
||||
// 6. If result is an abrupt completion, then report the exception given by result.[[Value]].
|
||||
if (result.is_error())
|
||||
HTML::report_exception(result);
|
||||
HTML::report_exception(result, finalization_registry.realm());
|
||||
});
|
||||
};
|
||||
|
||||
@@ -275,7 +275,7 @@ JS::VM& main_thread_vm()
|
||||
|
||||
// 5. If result is an abrupt completion, then report the exception given by result.[[Value]].
|
||||
if (result.is_error())
|
||||
HTML::report_exception(result);
|
||||
HTML::report_exception(result, job_settings->realm());
|
||||
});
|
||||
};
|
||||
|
||||
@@ -437,7 +437,7 @@ void queue_mutation_observer_microtask(DOM::Document& document)
|
||||
|
||||
auto result = WebIDL::invoke_callback(callback, mutation_observer.ptr(), wrapped_records, mutation_observer.ptr());
|
||||
if (result.is_abrupt())
|
||||
HTML::report_exception(result);
|
||||
HTML::report_exception(result, realm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user