Bug 136635

Summary: requestAnimationFrame callback is invoked with a wrong context
Product: WebKit Reporter: Andrea Giammarchi <andrea.giammarchi>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, bzbarsky, dino, ggaren, john.david.dalton, mathias
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Andrea Giammarchi 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.
Comment 1 Mathias Bynens 2014-09-08 10:31:40 PDT
See also: https://code.google.com/p/chromium/issues/detail?id=411959
Comment 2 Boris Zbarsky 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.
Comment 3 Andrea Giammarchi 2014-09-08 12:08:04 PDT
Boris is right, it was a copy and paste from Chromium, apologies.
Comment 4 Alexey Proskuryakov 2014-09-08 23:45:44 PDT

*** This bug has been marked as a duplicate of bug 126680 ***