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

[Bug 26183] make it easier to define an iterator on an interface that iterates over a set of values

From: <bugzilla@jessica.w3.org>
Date: Fri, 19 Sep 2014 22:37:05 +0000
To: public-script-coord@w3.org
Message-ID: <bug-26183-3890-ctjoUjZ6wF@http.www.w3.org/Bugs/Public/>

--- Comment #13 from Domenic Denicola <domenic@domenicdenicola.com> ---
Right, what you want is indeed traits. Partially because subclassing to impose
more restrictions is bad design, and partially because subclassing to impose
more restrictions just plain doesn't work in JavaScript. (Unlike in other
languages, where it's simply discouraged.)

There is really no way it makes sense, neither theoretically nor practically,
to put Map.prototype in the prototype chain. The Map.prototype methods are not
generic, so this case is very different from Array.

The correct thing to do here, instead of abusing the prototypal inheritance
hammer, is to turn to other tools (whether they be some future version of
traits, or just WebIDL).

You are receiving this mail because:
You are on the CC list for the bug.
Received on Friday, 19 September 2014 22:37:07 UTC

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