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

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

From: Brendan Eich <brendan@mozilla.org>
Date: Sat, 11 Aug 2012 12:21:58 -0700
Message-ID: <5026B0D6.1000608@mozilla.org>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>, public-script-coord@w3.org, es-discuss@mozilla.org
Allen Wirfs-Brock wrote:
> On Aug 10, 2012, at 11:14 PM, Brendan Eich wrote:
>>> In this case, firing the setter is perhaps what the programmer 
>>> wanted, even if it is a terrible way to accomplish that end.
>> It's not that bad if you start from the DOM level 0, especially 
>> window.onload being the same binding as function onload() {}.
> There seems to be a contradiction between what you describe above for 
> primordial and what ES1-3 said:

There was no contradiction in the old days. Writing

   function onload() {}

did not run a proto-setter to add an event listener. Rather, a load 
event fired by trying any function named by window.onload.

At some point this stopped working. Not sure when, but it's how JS + DOM 
level 0 worked in Netscape 2 when they debuted, and I believe for a long 
while after.

Received on Saturday, 11 August 2012 19:22:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:07 UTC