"var" declarations shadowing properties from Window.prototype
bzbarsky at MIT.EDU
Sun Aug 12 14:02:53 PDT 2012
On 8/12/12 4:55 PM, Boris Zbarsky wrote:
> There was a bunch of previous discussion about this at
> 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
Note that data in
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
More information about the es-discuss