Removal of WeakMap/WeakSet clear

Brendan Eich brendan at
Tue Dec 2 16:55:38 PST 2014

Good point about multi-gen. Lars Hansen even researched "oldest first" 

Clearly, Ungar's model was a simplification, with trade-offs as expected.

Allen Wirfs-Brock wrote:
> My main take-away from this discussion is that not have a 'clear' method on WeakMap/Set is indeed a simpler semantics and hence leaves GC designers more optimization opportunities.

Agreed. And we can always add .clear later. The worst case, where some 
leading implementation (oh, say, V8) adds it sooner, just forces the 
conclusion. But we should not force that conclusion now, absent evidence.


More information about the es-discuss mailing list