Re: variable declarations shadowing named properties on window

Boris Zbarsky:
> But then that would imply that other places that use [[HasProperty]]
> would need to return false too: the [[HasProperty]] call is not told
> that it's happening for a var binding.
>
> In particular, I believe that would make the HasBinding concrete method
> return false for all GSP properties on the window, which means they
> couldn't be looked up as barewords. But I could be misreading the spec,
> of course...

I think you're right there.

I'm feeling like moving all the named properties of Window to an object 
on the prototype chain would work best here:

   Object.prototype <- Window.prototype <- [named props obj] <- window

Is anyone doing Object.getPrototypeOf(window) and assuming it's 
Window.prototype?  A Google code search (enjoy it while it lasts) finds 
some people assigning to properties window.__proto__.  We could probably 
make that work on the named properties object.

Received on Thursday, 5 January 2012 01:28:46 UTC