Re: variable declarations shadowing named properties on window

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