Removal of WeakMap/WeakSet clear

Jason Orendorff jason.orendorff at gmail.com
Tue Dec 9 14:51:33 PST 2014


On Mon, Dec 8, 2014 at 3:46 PM, Tab Atkins Jr. <jackalmage at gmail.com> wrote:
> On Thu, Dec 4, 2014 at 9:46 PM, Katelyn Gadd <kg at luminance.org> wrote:
>> I'm surprised to hear that JS runtimes don't necessarily have ways to
>> 'hash' a given JS value [...]
>
> JS has maps/sets that take objects natively, hiding any details about
> how a mutable object is tracked/stored as keys or values, so there's
> never been any need for such a thing.

It's not rare to want a hashmaps with compound keys. In current JS
there's no convenient, efficient way to make such a hash. If value
types are still happening, they might solve that problem.

> Explicitly exposing hash codes
> is leaking implementation details into the user-facing API.

This is certainly true and (afaik) the reason we haven't exposed this
kind of feature so far.

-j


More information about the es-discuss mailing list