W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2012

Re: variable declarations shadowing named properties on window

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 04 Jan 2012 15:12:08 -0500
Message-ID: <4F04B298.1040807@mit.edu>
To: Travis Leithead <travis.leithead@microsoft.com>
CC: Ojan Vafai <ojan@chromium.org>, Cameron McCormack <cam@mcc.id.au>, "public-script-coord@w3.org" <public-script-coord@w3.org>, Allen Wirfs-Brock <allen@wirfs-brock.com>, Ian Hickson <ian@hixie.ch>
On 1/4/12 3:00 PM, Travis Leithead wrote:
>> Agreed on proto chain.  Per spec, var should not look at the proto chain
>> before defining the property on the global.
> In that case, Chrome/Safari are clearly wrong according to my test. But that's beside the point.

Yeah, they are.  There were some spec changes here a while back; they 
may not have updated to those yet.

> Let me make sure that I understand you use of "GSP". There are pre-defined properties (as described in the "interface Window" per HTML5). Those are included in the window's prototype chain (not on the window instance/global itself.

Yes, agreed.

> Then there are "dynamic" properties which in IE include frame names, frame indexes, and elements with id, etc. I assume by GSP that you refer to the latter.

Yes.  Though in Gecko there's a difference in behavior between frame 
names and elements with id.  The former live on the window host object 
(not a proxy; it doesn't actually have proxy-like behavior).  The latter 
live on a host object that sits on the prototype chain of the window, 
not on the window itself.

> IE's GSP is tied to the proxy object around the window instance/global object -- it's not in the prototype chain. Think of IE's GSP as a look-aside object of the window instance.

That makes sense for access via window.somename.

But for a bareword somename, is there a proxy involved in IE?

That is, is the ES global in IE actually a proxy and not a "native" object?

It really sounds like the behavior IE has here is not actually 
describable in terms of the ES spec (even with proxies, if I understand 
it correctly) as things stand...

Received on Wednesday, 4 January 2012 20:12:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:05 UTC