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

On 8/11/12 10:42 PM, Brendan Eich wrote:
> However, implementations (at least Gecko) give window a proto chain that
> is "interesting":

Indeed.  For one thing, we haven't switched Window to the new bindings yet.

> This is from a stable-release Firefox Web Console. I believe it matches
> a real DOM content window. I don't see EventTarget

Because it's not on the proto chain at all; in Gecko as of today Window 
doesn't inherit from EventTarget; instead "Window implements 
EventTarget", effectively.  Again, we just haven't switched Window to 
WebIDL yet.

The Global Scope Polluter you see there, though, is in fact defined in 
WebIDL.

> The global object's prototype chain must end with Object.prototype (ES5
> says so, IIRC).

Yes.

> But the exact chain is not something that should be
> standardized in detail.

Why not?

-Boris

Received on Sunday, 12 August 2012 17:14:30 UTC