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 14:36:04 -0500
Message-ID: <4F04AA24.3000003@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 2:28 PM, Travis Leithead wrote:
> I'm going to reason about an implementation detail without verifying it here... my guess is that the var declaration code (without assignment) is failing to perform a full lookup of the window object before assigning the var.

What |var| should do is look for an own property on the global and 
create one if there isn't one.

> So, in IE, Firefox, and Opera, the prototype chain (and by inference the GSP) is not even getting consulted given the proposed lookup order and this scenario.

Agreed on proto chain.  Per spec, var should not look at the proto chain 
before defining the property on the global.

My question is precisely about the "by inference the GSP" part.  In 
_Gecko_, the GSP is an object on the proto chain of the window; those 
properties to not live on the window object itself.  Per current WebIDL 
spec, the GSP properties just live on the window object itself.  What 
does IE do with GSP properties?  What about Opera?

>> Or does IE put all its GSPs, including frame names, on the proto chain
>> and not on the object itself?

This is the question I'd really like an answer to.

-Boris
Received on Wednesday, 4 January 2012 19:36:38 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:05 UTC