Removal of WeakMap/WeakSet clear

Tab Atkins Jr. jackalmage at gmail.com
Mon Dec 8 13:46:11 PST 2014


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, but it makes sense. I can see how that is a
> great reason for 'get me a hash for this value' to never actually
> exist in the API, even if it's unfortunate that I have to recreate
> that facility myself in runtimes that do have it.

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.  Explicitly exposing hash codes
is leaking implementation details into the user-facing API.

~TJ


More information about the es-discuss mailing list