LibWeb: Report exceptions when invoking intersection observer callback

This commit is contained in:
Tim Ledbetter 2024-12-05 09:59:50 +00:00 committed by Tim Ledbetter
commit 7a41ab960c
Notes: github-actions[bot] 2024-12-19 15:26:21 +00:00
3 changed files with 38 additions and 3 deletions

View file

@ -4009,9 +4009,8 @@ void Document::queue_intersection_observer_task()
auto& callback = observer->callback();
// 5. Invoke callback with queue as the first argument, observer as the second argument, and observer as the callback this value. If this throws an exception, report the exception.
auto completion = WebIDL::invoke_callback(callback, observer.ptr(), wrapped_queue, observer.ptr());
if (completion.is_abrupt())
HTML::report_exception(completion, realm);
// NOTE: This does not follow the spec as written precisely, but this is the same thing we do elsewhere and there is a WPT test that relies on this.
(void)WebIDL::invoke_callback(callback, observer.ptr(), WebIDL::ExceptionBehavior::Report, wrapped_queue, observer.ptr());
}
}));
}