Bug 136635
Summary: | requestAnimationFrame callback is invoked with a wrong context | ||
---|---|---|---|
Product: | WebKit | Reporter: | Andrea Giammarchi <andrea.giammarchi> |
Component: | WebCore JavaScript | Assignee: | 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 |
Andrea Giammarchi
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mathias Bynens
See also: https://code.google.com/p/chromium/issues/detail?id=411959
Boris Zbarsky
>3. see that `window` is alerted instead of `undefined`
Not quite. What's alerted is the function that was passed to requestAnimationFrame.
Andrea Giammarchi
Boris is right, it was a copy and paste from Chromium, apologies.
Alexey Proskuryakov
*** This bug has been marked as a duplicate of bug 126680 ***