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

Re: WindowProxy objects violate ES5 invariants

From: David Bruant <bruant.d@gmail.com>
Date: Sat, 15 Dec 2012 18:05:31 +0100
Message-ID: <50CCADDB.8040801@gmail.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: public-script-coord@w3.org
Le 15/12/2012 17:45, Boris Zbarsky a écrit :
> On 12/15/12 9:05 AM, David Bruant wrote:
>> A little point that may make things a little bit annoying: when a
>> variable is declared globally with "var" (I assume "let" too and it's
>> worse with "const") or a function declared globally, the
>> variable/function name is currently reflected as a non-configurable
>> property of the global object (I don't know if it's a DOM or an
>> ECMAScript thing).
> Oh, indeed.  This is an ECMAScript thing.  See ES5 section 10.5 step 2 
> and then step 8.c.i, which calls section
Thanks for the reference.
I guess that reveals a different invariant violation :-)

> So yeah, WindowProxy would have to have some sort of whitelist of 
> things that are configurable
I guess you meant "non-configurable" here.

> if we wanted to report the [Unforgeable] stuff as configurable.
"non-configurable" here too.

Assuming you meant "non-configurable" in both cases, I agree with you.
But it creates a violation of ES5, because it means that 
var/let/const/function global declaration aren't reflected as 
non-configurable (while the section you linked too expects them to). I 
think the solution may just be to reflect as configurable, but act as if 
it was non-configurable (and I guess non-writable for "const" declarations)
I'll bring this issue to es-discuss as it's a more relevant place to 
talk about this problem.


Received on Saturday, 15 December 2012 17:06:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:08 UTC