Overriding Map/etc with get/set hooks?

Anne van Kesteren annevk at annevk.nl
Tue May 21 06:52:01 PDT 2013


On Tue, May 21, 2013 at 12:19 PM, Brendan Eich <brendan at mozilla.com> wrote:
> Of course, coercing key type makes the API not Map. So if the
> bi-directionality is important, this would be a custom Map-like class.

I guess I also do not really get this. Sure JavaScript does not have a
type system (yet?), but it seems that placing restrictions / coercion
on input does not invalidate any of the properties of a map other than
that there's a restriction on what goes in the map. To me that seems
very much like a subset of a map and all generic functionality written
around maps would work on such a map.


--
http://annevankesteren.nl/


More information about the es-discuss mailing list