diff --git a/Libraries/LibWeb/DOM/Window.cpp b/Libraries/LibWeb/DOM/Window.cpp index 898e466bc0..b1c9037229 100644 --- a/Libraries/LibWeb/DOM/Window.cpp +++ b/Libraries/LibWeb/DOM/Window.cpp @@ -68,7 +68,8 @@ void Window::set_interval(JS::Function& callback, i32 interval) (void)Core::Timer::construct(interval, [handle = make_handle(&callback)] { auto& function = const_cast(static_cast(*handle.cell())); auto& interpreter = function.interpreter(); - interpreter.call(function); + auto& window = static_cast(interpreter.global_object()); + interpreter.call(function, &window); }).leak_ref(); } @@ -78,7 +79,8 @@ void Window::set_timeout(JS::Function& callback, i32 interval) auto& timer = Core::Timer::construct(interval, [handle = make_handle(&callback)] { auto& function = const_cast(static_cast(*handle.cell())); auto& interpreter = function.interpreter(); - interpreter.call(function); + auto& window = static_cast(interpreter.global_object()); + interpreter.call(function, &window); }).leak_ref(); timer.set_single_shot(true); }