- From: Olli Pettay <Olli.Pettay@helsinki.fi>
- Date: Sun, 31 Oct 2010 22:59:12 +0100
- To: Travis Leithead <travil@microsoft.com>
- CC: Cameron McCormack <cam@mcc.id.au>, "Mark S. Miller" <erights@google.com>, Shiki Okasaka <shiki@google.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>, Adrian Bateman <adrianba@microsoft.com>
On 10/21/2010 11:50 PM, Travis Leithead wrote: > OK, looking forward to a discussion around this. In IE9, we are > mixing in interfaces (and inherited interfaces of mixin interfaces) > onto the "implements" target's prototype. > > For example: > > [NoInterfaceObject] interface EventTarget { void > addEventListener(..); }; > > Window implements EventTarget; Node implements EventTarget; > XMLHttpRequest implements EventTarget; > > The above would create three copies of the addEventListener API on > each of Window.prototype, Node.prototype, and > XMLHttpRequest.prototype. We favored this simplicity over the desire > to have a single addEventListener definition that could be configured > to affect all implementing interfaces. The extra redundancy in API > definitions hasn't posed a problem for us yet :) Why couldn't Window, Node and XHR just (effectively) inherit EventTarget so that .prototype.prototype had addEventListener (only one copy)? -Olli
Received on Sunday, 31 October 2010 23:00:40 UTC