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


--- 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