W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2012

Re: "var" declarations shadowing properties from Window.prototype

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 12 Aug 2012 12:58:22 -0400
Message-ID: <5027E0AE.9000501@mit.edu>
To: Brendan Eich <brendan@mozilla.com>
CC: Cameron McCormack <cam@mcc.id.au>, public-script-coord@w3.org, es-discuss@mozilla.org
On 8/11/12 9:16 PM, Brendan Eich wrote:
> As bz and others point out, the object detection w/ var pattern can
> arise for operations, e.g. for requestAnimationFrame, using the same
>
>    var requestAnimationFrame = window.mozRequestAnimationFrame || ... ||
> window.requestAnimationFrame;
>
> pattern. So WebIDL operations (JS methods) on the global would be
> promoted to "own" too. They'd be configurable, if I recall correctly,
> and either writable or replaceable. Do I have that right?

This is unnecessary if we stick with the current var wording in 5.1.

If this _is_ done, that will mean hooking 
EventTarget.prototype.addEventListener won't hook adds on the global, 
which is a bit weird.

-Boris
Received on Sunday, 12 August 2012 16:58:53 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC