"var" declarations shadowing properties from Window.prototype

Brendan Eich brendan at mozilla.com
Sun Aug 12 11:02:09 PDT 2012

Boris Zbarsky wrote:
> On 8/11/12 10:57 PM, Brendan Eich wrote:
>> I think WebIDL and interface-based method definition made onload, 
>> e.g., predefined on
>> window objects, or more recently on Window.prototype. Was this useful?
> It's required for web compat, as I said earlier in this thread.  They 
> _could_ perhaps be predefined as data properties set to null,

Right, Brandon Benvie raised this idea. It goes back to the simpler data 
(and masquerading native accessor) model of ur-JS/DOM.

> but data properties which have as a side effect of setting them to a 
> function object the registration of an event listener... which starts 
> to look a lot like an accessor property to me.

It does, unless there's an equivalent "polling" semantics where no 
registration is required, just recurring [[Get]] probes (with caching 
optimizations, whatever -- all unobservable so out of the spec's sight). 
Is there such an equivalent "polling" or "probing" semantics?


More information about the es-discuss mailing list