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

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