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

Re: variable declarations shadowing named properties on window

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 05 Jan 2012 12:37:54 +1100
Message-ID: <4F04FEF2.9020505@mcc.id.au>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: Travis Leithead <travis.leithead@microsoft.com>, Ojan Vafai <ojan@chromium.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>, Allen Wirfs-Brock <allen@wirfs-brock.com>, Ian Hickson <ian@hixie.ch>
Boris Zbarsky:
> What Gecko actually uses is more like this, I believe:
> Object.prototype <- [named props obj] <- Window.prototype <- window
> Note that this does not obviate the need for the no-overriding-builtins
> stuff, though, because you don't want to shadow Object.prototype on the
> named props object either...


> So it might be possible to move the named props object to the other spot
> in the proto chain.

Even though there's only one instance of Window that inherits from a 
given Window.prototype, it makes slightly more sense to me to have the 
instance-specific named properties object closer to the instance, before 
inheriting from Window.prototype.

I think we can just trigger this "add an extra object in the proto 
chain" based on [ReplaceableNamedProperties], so no changes to HTML's 
IDL would be needed.
Received on Thursday, 5 January 2012 01:38:36 UTC

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