W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2012

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

From: Rick Waldron <waldron.rick@gmail.com>
Date: Fri, 10 Aug 2012 16:35:00 -0400
Message-ID: <CAHfnhfq-oT2osjPFm2mvd+CH618si2FARbFwuBMux=aU+pcZ-g@mail.gmail.com>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, public-script-coord@w3.org, es-discuss@mozilla.org
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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC