Use cases for WeakMap

Brendan Eich brendan at mozilla.com
Mon May 16 13:26:09 PDT 2011


On May 16, 2011, at 1:15 PM, Oliver Hunt wrote:

> On May 16, 2011, at 1:07 PM, Brendan Eich wrote:
>> WeakMaps satisfy this more general non-enumerable object-keyed cache use-case well, too -- at least as far as I can tell. We'll be building on the Firefox nightly implementation to find out more.
> 
> I think my problem with this is that WeakMap to me imply something other than what is being specified.  What is being specified here is essentially a non-enumerable strong map,

No, not strong -- conditionally strong or weak.

If you want to pick on the name for imprecision, you have to be more precise. That's the first rule of weakmap-club.


> not a weakmap in the sense that i have ever known it.

I believe you are still thinking of weak references or weak pointers. Can you link to an example of what you mean?

/be



More information about the es-discuss mailing list