mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
LibWeb: Remove now-unnecessary JS::Handles in microtask capture lists
This commit is contained in:
parent
874e64d664
commit
37ea6de772
2 changed files with 3 additions and 3 deletions
|
@ -220,7 +220,7 @@ JS::VM& main_thread_vm()
|
||||||
auto* script = active_script();
|
auto* script = active_script();
|
||||||
|
|
||||||
// NOTE: This keeps job_settings alive by keeping realm alive, which is holding onto job_settings.
|
// NOTE: This keeps job_settings alive by keeping realm alive, which is holding onto job_settings.
|
||||||
HTML::queue_a_microtask(script ? script->settings_object().responsible_document().ptr() : nullptr, [job_settings, job = move(job), realm = realm ? JS::make_handle(realm) : JS::Handle<JS::Realm> {}, script_or_module = move(script_or_module)]() mutable {
|
HTML::queue_a_microtask(script ? script->settings_object().responsible_document().ptr() : nullptr, [job_settings, job = move(job), realm, script_or_module = move(script_or_module)]() mutable {
|
||||||
// The dummy execution context has to be kept up here to keep it alive for the duration of the function.
|
// The dummy execution context has to be kept up here to keep it alive for the duration of the function.
|
||||||
Optional<JS::ExecutionContext> dummy_execution_context;
|
Optional<JS::ExecutionContext> dummy_execution_context;
|
||||||
|
|
||||||
|
|
|
@ -509,8 +509,8 @@ void Window::fire_a_page_transition_event(FlyString const& event_name, bool pers
|
||||||
void Window::queue_microtask_impl(Bindings::CallbackType& callback)
|
void Window::queue_microtask_impl(Bindings::CallbackType& callback)
|
||||||
{
|
{
|
||||||
// The queueMicrotask(callback) method must queue a microtask to invoke callback,
|
// The queueMicrotask(callback) method must queue a microtask to invoke callback,
|
||||||
HTML::queue_a_microtask(&associated_document(), [callback = JS::make_handle(callback)]() mutable {
|
HTML::queue_a_microtask(&associated_document(), [&callback]() mutable {
|
||||||
auto result = Bindings::IDL::invoke_callback(*callback, {});
|
auto result = Bindings::IDL::invoke_callback(callback, {});
|
||||||
// and if callback throws an exception, report the exception.
|
// and if callback throws an exception, report the exception.
|
||||||
if (result.is_error())
|
if (result.is_error())
|
||||||
HTML::report_exception(result);
|
HTML::report_exception(result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue