Irakli Gozalishvili wrote:
I really need to know why WeakMaps don't accept primitives as keys,
can anyone please reply ?
How would the GC know when to remove the entry from the map? Because a
primitive is never (or always, if wrapped) eligible for
garbage-collection, a WeakMap does not help your use case.
A WeakMap will not give you your time-limited cache. You still have to
implement that yourself.
-Eric
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss