diff options
author | Linus Groh <mail@linusgroh.de> | 2021-03-26 19:35:54 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-26 22:59:47 +0100 |
commit | 056ffa4abb1480830b9887d1a73b6fdbc87747eb (patch) | |
tree | 6a020fa7b2018a6d26c6794227f47dde651479cb | |
parent | 49a062f81d8e943e64a142f3f1f0fe955ebcf470 (diff) | |
download | serenity-056ffa4abb1480830b9887d1a73b6fdbc87747eb.zip |
LibWeb: Call requestAnimationFrame() callback with undefined this value
We were leaking an empty value via the callback's this value:
requestAnimationFrame(function () {
this; // <-- empty value
});
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Window.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Window.cpp b/Userland/Libraries/LibWeb/DOM/Window.cpp index 62c327fd75..52607e2ab8 100644 --- a/Userland/Libraries/LibWeb/DOM/Window.cpp +++ b/Userland/Libraries/LibWeb/DOM/Window.cpp @@ -140,7 +140,7 @@ i32 Window::request_animation_frame(JS::Function& callback) auto& function = const_cast<JS::Function&>(static_cast<const JS::Function&>(*handle.cell())); auto& vm = function.vm(); fake_timestamp += 10; - [[maybe_unused]] auto rc = vm.call(function, {}, JS::Value(fake_timestamp)); + [[maybe_unused]] auto rc = vm.call(function, JS::js_undefined(), JS::Value(fake_timestamp)); if (vm.exception()) vm.clear_exception(); GUI::DisplayLink::unregister_callback(link_id); |