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

Re: variable declarations shadowing named properties on window

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 05 Jan 2012 22:02:13 -0500
Message-ID: <4F066435.2030903@mit.edu>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
CC: Ojan Vafai <ojan@chromium.org>, Cameron McCormack <cam@mcc.id.au>, Travis Leithead <travis.leithead@microsoft.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>, Ian Hickson <ian@hixie.ch>, Jeff Walden <jwalden@mit.edu>
On 1/5/12 9:44 PM, Allen Wirfs-Brock wrote:
> I believe that this is the change Boris is referring to:
> https://bugs.ecmascript.org/show_bug.cgi?id=78

Yes, thank you.  Any chance of the revised text making it to a spec 
somewhere where people might see it (and maybe even fix existing 
implementations)?  ;)

In any case, the updated text says that if HasBinding returns true then 
the implementation should call [[GetOwnProperty]] on the global.  If 
this returns undefined, then [[DefineOwnProperty]] is called on the 
global with the property descriptor: {[[Value]]: undefined, 
[[Writable]]: true, [[Enumerable]]: true , [[Configurable]]: 
configurableBindings }.

So now to make var shadow some property that property needs to either 
return false from HasBinding or return undefined from [[GetOwnProperty]].

Cameron, can GSP properties return undefined from [[GetOwnProperty]] but 
still do what they should for window.foo and bareword lookups without 
other things elsewhere breaking?

-Boris
Received on Friday, 6 January 2012 05:50:38 UTC

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