mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb: Fire error event when script has an execution error
We now use the "report an exception" AO when a script has an execution error. This has mostly replaced the older "report the exception" AO in various specifications. Using this newer AO ensures that `window.onerror` is invoked when a script has an execution error.
This commit is contained in:
parent
994457d7af
commit
579a289d3d
Notes:
github-actions[bot]
2024-09-27 11:03:15 +00:00
Author: https://github.com/tcl3
Commit: 579a289d3d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1548
6 changed files with 35 additions and 4 deletions
|
@ -746,6 +746,13 @@ JS::NonnullGCPtr<JS::Object> WindowOrWorkerGlobalScopeMixin::supported_entry_typ
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-reporterror
|
||||
void WindowOrWorkerGlobalScopeMixin::report_error(JS::Value e)
|
||||
{
|
||||
// The reportError(e) method steps are to report an exception e for this.
|
||||
report_an_exception(e);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#report-an-exception
|
||||
void WindowOrWorkerGlobalScopeMixin::report_an_exception(JS::Value const& e)
|
||||
{
|
||||
auto& target = static_cast<DOM::EventTarget&>(this_impl());
|
||||
auto& realm = relevant_realm(target);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue