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

On Fri, Aug 10, 2012 at 4:11 PM, Allen Wirfs-Brock <allen@wirfs-brock.com>wrote:

>
> Neither ES5 or ES5.1 does a "own" check for either global var or function
> declarations. See 10.5 step 5.c/8.b each of which calls HasBinding
> 10.2.1.2.1 which does a [[HasProperty]] which, if necessary, looks up the
> [[Prototype]] chain.
>
> The change made in ES5.1 (renumbered existing ES5 10.5 step 5.e as 5.f and
> inserted a new step 5.e + substeps related to dealing with function
> declarations that over-wrote accessor properties (both own or inherited) of
> the global object as well function declarations that tried to redefined
> non-configurable global object properties.  This change was motivated by
> https://bugzilla.mozilla.org/show_bug.cgi?id=577325 and the es-discuss
> thread referenced in that bug.
>
> Note that the ES5.1 change only related to function declarations.  ES5.1
> did not  make any changes to the specified semantics of global var
> declarations.
>

I just reviewed test262 and there aren't any tests that are specifically
dedicated, however there is a ticket filed here:
https://bugs.ecmascript.org/show_bug.cgi?id=315


Rick

Received on Friday, 10 August 2012 20:35:49 UTC