LibWeb: Remove now-unnecessary JS::Handles in HTML task capture lists

JS::SafeFunction will protect anything captures for HTML tasks now.
This commit is contained in:
Andreas Kling 2022-09-24 12:12:42 +02:00
parent d505192014
commit 2ccb9bef49
Notes: sideshowbarker 2024-07-17 06:41:12 +09:00
6 changed files with 22 additions and 22 deletions

View file

@ -195,7 +195,7 @@ void EnvironmentSettingsObject::notify_about_rejected_promises(Badge<EventLoop>)
auto& global = global_object();
// 5. Queue a global task on the DOM manipulation task source given global to run the following substep:
queue_global_task(Task::Source::DOMManipulation, global, [this, global = JS::make_handle(&global), list = move(list)]() mutable {
queue_global_task(Task::Source::DOMManipulation, global, [this, &global, list = move(list)]() mutable {
// 1. For each promise p in list:
for (auto promise_handle : list) {
auto& promise = *promise_handle.cell();
@ -217,7 +217,7 @@ void EnvironmentSettingsObject::notify_about_rejected_promises(Badge<EventLoop>)
/* .reason = */ promise.result(),
};
// FIXME: This currently assumes that global is a WindowObject.
auto& window = verify_cast<HTML::Window>(*global.cell());
auto& window = verify_cast<HTML::Window>(global);
auto promise_rejection_event = PromiseRejectionEvent::create(window, HTML::EventNames::unhandledrejection, event_init);