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

On 8/12/12 4:55 PM, Boris Zbarsky wrote:
> There was a bunch of previous discussion about this at
> http://lists.w3.org/Archives/Public/public-script-coord/2012JanMar/0010.html
> and following, though it's not clear to me now whether the solution we
> decided on allows var to shadow these named props as desired after all...

And in particular, it's interesting to compare the claims from Ojan in 
that thread about web developer desires to the practice of what they 
actually expect that we ran into with indexedDB...

In any case, it does sound to me like putting the GSP on the proto chain 
is not enough to get the behavior if the ES5.1 behavior stays as-is 
unless it explicitly checks for props on the global itself a la 
http://lists.w3.org/Archives/Public/public-script-coord/2012JanMar/0030.html

Note that data in 
http://lists.w3.org/Archives/Public/public-script-coord/2012JanMar/0033.html 
suggests that IE also implements the erratum to 5.1 we were talking 
about up-thread.  Oh what a tangled web we weave.

But the whole thread is worth reading (even if I was just as confused 
back then about the spec status of the var shadowing behavior: I thought 
it was in ES5, not in an erratum to 5.1).  If nothing else it contains 
somewhat of a description of how Gecko and IE implement their global 
scope polluters.

-Boris

Received on Sunday, 12 August 2012 21:03:27 UTC