RESOLVED DUPLICATE of bug 126680 136635
requestAnimationFrame callback is invoked with a wrong context
https://bugs.webkit.org/show_bug.cgi?id=136635
Summary requestAnimationFrame callback is invoked with a wrong context
Andrea Giammarchi
Reported 2014-09-08 10:29:07 PDT
Steps to reproduce the problem: 1. write the following in a console 2. requestAnimationFrame(function(){'use strict';alert(this)}); 3. see that `window` is alerted instead of `undefined` What is the expected behavior? function should be invoked with undefined context to fullfill both sloppy and strict expectations What went wrong? suddenly, the wild global context appears ... Did this work before? No Chrome version: 39.0.2149.0 Channel: canary OS Version: OS X 10.8.5 Flash Version: Shockwave Flash 15.0 r0 every single Chrome I could test with requestAnimationFrame out of its prefixed version.
Attachments
Mathias Bynens
Comment 1 2014-09-08 10:31:40 PDT
Boris Zbarsky
Comment 2 2014-09-08 10:40:36 PDT
>3. see that `window` is alerted instead of `undefined` Not quite. What's alerted is the function that was passed to requestAnimationFrame.
Andrea Giammarchi
Comment 3 2014-09-08 12:08:04 PDT
Boris is right, it was a copy and paste from Chromium, apologies.
Alexey Proskuryakov
Comment 4 2014-09-08 23:45:44 PDT
*** This bug has been marked as a duplicate of bug 126680 ***
Note You need to log in before you can comment on or make changes to this bug.