Bug 136635 - requestAnimationFrame callback is invoked with a wrong context
Summary: requestAnimationFrame callback is invoked with a wrong context
Status: RESOLVED DUPLICATE of bug 126680
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-08 10:29 PDT by Andrea Giammarchi
Modified: 2014-09-08 23:45 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***