From b59c1fbf7358bf46ac80c187eb486e65db0d8e31 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 26 Mar 2025 18:50:46 -0400 Subject: [PATCH] LibWeb: Report unhandled exceptions to the developer console This was a spec bug which led to us reporting handled (rather than unhandled) exceptions. See: https://github.com/whatwg/html/commit/2d7f50a --- Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp b/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp index 1064aa39051..5d95a07b8ee 100644 --- a/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp +++ b/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp @@ -1001,10 +1001,10 @@ void WindowOrWorkerGlobalScopeMixin::report_an_exception(JS::Value exception, Om // FIXME: 3. If notHandled is true, then report exception for workerObject's relevant global object with // omitError set to true. } - } - // 8. Otherwise, the user agent may report exception to a developer console. - else { - report_exception_to_console(exception, realm, ErrorInPromise::No); + // 3. Otherwise, the user agent may report exception to a developer console. + else { + report_exception_to_console(exception, realm, ErrorInPromise::No); + } } }