"var" declarations shadowing properties from Window.prototype

Cameron McCormack cam at mcc.id.au
Sat Aug 11 18:55:09 PDT 2012


Kyle Huey:
> 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.

We could.  You're right it's not changing much, but I wouldn't want to 
box ourselves in to not being able to extend it later.  But maybe it's 
less likely that people will try to use the

   var newEventTargetFunction = window.newEventTargetFunction ||
                                window.mozNewEventTargetFunction || ...

pattern there.


More information about the es-discuss mailing list