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: Wed, 04 Jan 2012 20:03:06 -0500
Message-ID: <4F04F6CA.5020604@mit.edu>
To: Ojan Vafai <ojan@chromium.org>
CC: Travis Leithead <travis.leithead@microsoft.com>, Cameron McCormack <cam@mcc.id.au>, "public-script-coord@w3.org" <public-script-coord@w3.org>, Allen Wirfs-Brock <allen@wirfs-brock.com>, Ian Hickson <ian@hixie.ch>
On 1/4/12 5:53 PM, Ojan Vafai wrote:
> TL;DR: It's fine for "var x" to shadow ids/names, but not override
> existing global variables.

Yes, except per current WebIDL spec they look identical to the code 
that's supposed to implement var, afaict.

I agree that we don't want to override actual page-defined global variables.

That means that the ids/names/frame-names/whatever probably need to not 
be own properties on the global if we want var to override them.

> I expect that for web compat "var x" needs to not
> override existing global variables.

I expect so too.

Received on Thursday, 5 January 2012 01:03:39 UTC

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