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

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