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

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

From: Kyle Huey <me@kylehuey.com>
Date: Sat, 11 Aug 2012 18:51:19 -0700
Message-ID: <CAP045Ao72A-8WHbO2_dr8qsYEonsy5VjhzpHOSqAUsO2XP4z7w@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: Brendan Eich <brendan@mozilla.com>, Boris Zbarsky <bzbarsky@mit.edu>, public-script-coord@w3.org, es-discuss@mozilla.org
On Sat, Aug 11, 2012 at 6:46 PM, Cameron McCormack <cam@mcc.id.au> wrote:

> Brendan Eich:
>
>  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?
>>
>
> OK.  So one thing that I think has been pointed out is that moving
> properties for operations on to window makes it harder to monkeypatch
> addEventListener and friends.  We *could*, if we thought it was important,
> have the properties on window forward on to the ones from the prototype.
>

Can we leave EventTarget's methods on the proto chain and only move the
ones on the Window interface itself?  Unlike Window, EventTarget isn't
changing very much.

- Kyle
Received on Sunday, 12 August 2012 01:51:49 UTC

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