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

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

From: Travis Leithead <travis.leithead@microsoft.com>
Date: Thu, 16 Aug 2012 22:20:38 +0000
To: Brendan Eich <brendan@mozilla.com>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>, Brandon Benvie <brandon@brandonbenvie.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>, "es-discuss@mozilla.org" <es-discuss@mozilla.org>, Jonas Sicking <jonas@sicking.cc>
Message-ID: <9768D477C67135458BF978A45BCF9B38384078F3@TK5EX14MBXW604.wingroup.windeploy.ntdev.microsoft.com>
> From: Brendan Eich [mailto:brendan@mozilla.com]
> Travis Leithead wrote:
> > I still have my doubts about the magnitude of this problem,
> Which problem? Clearly not all stable browsers have rolled out the ES5.1
> erratum fix whereby var ignores the prototype chain. Also clearly, WebKit-
> based browsers bind attribiutes as "own" properties. We won't know unless
> and and until all browsers take the heat we're taking.
> Not sure you're taking this heat yet either!

No, we seemed to have lucked out in that regard.

> Furthermore, independent of this issue, I raised the (in hindsight
> untenable) injection of readonly attributes onto the global object or its
> prototype chain. This is just bad for backward compatibility on principle, and
> based on 16 years of experience. It's why we have [Replaceable]. So I think
> we should do something along the suggested lines (making that the default).
> > but if I'm wrong then I'd at least like to be able to grandfather-in some
> legacy APIs like addEventListener (or other APIs that make sense to have a
> single shared entry point for easy monkey patching).
> Is this a used use-case? There's no grandfathering if WebKit-based browsers
> and Opera have never done it.

It's an ideal we strive for, but as you say, not widely implemented...

> Are you guys using EventTarget.prototype.addEventListener = ... to affect
> window's event listening?

...just like the proposal to have everything inherit from EventTarget. IE currently mixes the API into all the relevant objects, so we're not practicing what we preach here.

Received on Thursday, 16 August 2012 22:21:14 UTC

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