LibWeb: Use as to cast global object to WindowOrWorkerGlobalScopeMixin

No functional changes.
This commit is contained in:
Tim Ledbetter
2025-02-02 15:42:57 +00:00
committed by Jelle Raaijmakers
parent 3794665b0b
commit 6d7b7e7822
10 changed files with 30 additions and 44 deletions

View File

@@ -327,9 +327,8 @@ JS::Completion invoke_callback(WebIDL::CallbackType& callback, Optional<JS::Valu
// FIXME: 1. Assert: callables return type is undefined or any.
// 2. Report an exception completion.[[Value]] for relevant realms global object.
auto* window_or_worker = dynamic_cast<HTML::WindowOrWorkerGlobalScopeMixin*>(&relevant_realm.global_object());
VERIFY(window_or_worker);
window_or_worker->report_an_exception(*completion.release_value());
auto& window_or_worker = as<HTML::WindowOrWorkerGlobalScopeMixin>(relevant_realm.global_object());
window_or_worker.report_an_exception(*completion.release_value());
// 3. Return the unique undefined IDL value.
return JS::js_undefined();