A WeakMap where values (not keys) are weak references?

Boris Zbarsky bzbarsky at mit.edu
Tue Mar 21 14:20:07 UTC 2017


On 3/21/17 2:15 AM, /#!/JoePea wrote:
> I'd like to have something like a WeakMap where the keys can be
> primitives and the values are weakly-held Objects

It might be worth searching the archives: this has been proposed 
multiple times and discussed at quite some length.

If there isn't an existing document that summarizes the discussions (and 
quick searching doesn't find one in the top several hits, though it does 
find https://esdiscuss.org/topic/what-is-the-status-of-weak-references 
at the very least), there really should be one...

-Boris


More information about the es-discuss mailing list