Questioning WeakMap.prototype.clear

Allen Wirfs-Brock allen at
Mon Jan 21 11:52:45 PST 2013

On Jan 21, 2013, at 11:36 AM, Rick Waldron wrote:

> This is the reality check I can get behind—I'm hard pressed to come up with a use case that isn't contrived or solvable by some other means. 
This is easy:

I'm do phased traversals over a complex data structure.  I have a number of functions that collaborative perform the function and they share access to a WeakMap to cache relationships that they identify over the course of the traversal.  When I start a new traversal phase I want to flush the cache so I use the clear method to do so.


More information about the es-discuss mailing list