This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html Multipage: http://www.whatwg.org/C#timers Complete: http://www.whatwg.org/c#timers Comment: Need to clearly define this objects for setTimeout and setInterval Posted from: 64.213.70.194 by bzbarsky@mit.edu User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/19.0 Firefox/19.0
If code in window A calls setTimeout on window B with a function from window A, then when the function is called it's interoperably using window B as "this". That includes strict mode functions at least in Chrome and Firefox. The spec right now says to pass undefined as this, which should cause the function to use "the" global. But of course ES doesn't define multi-global situations in any way.... and in any case what the spec says is not compatible with what UAs actually do.
So I should just pass the WindowProxy object of the Window object on which setTimeout/setInterval was called, instead of passing undefined?
That's what I'm doing in the Gecko implementation of this stuff on top of WebIDL, yeah.
Checked in as WHATWG revision r7737. Check-in comment: Try to more closely match reality. http://html5.org/tools/web-apps-tracker?from=7736&to=7737