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 13:04:53 -0400
Message-ID: <5027E235.5050606@mit.edu>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
CC: Brendan Eich <brendan@mozilla.org>, public-script-coord@w3.org, es-discuss@mozilla.org
On 8/11/12 9:48 PM, Allen Wirfs-Brock wrote:
> I see, this makes perfect sense when onload is viewed simply as a passive property.

That stops being an option once addEventListener also appears, for what 
it's worth.

> It is turning into an active side-effecting registration mechanism that conceptually clashed with function declarations.  I wonder why that was necessary.

Because event listener ordering matters, so you have to register the 
event listener when onload property is set.  Now the question is what 
that listener does: it could just take the thing it's given, or it could 
dynamically look up "onload" on the global.  At some point Gecko used to 
do the latter; it would be interesting to check why we stopped.  It's 
all in the revision history!

-Boris
Received on Sunday, 12 August 2012 17:05:23 UTC

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