The set of values actually contained by the WeakMap at any moment is
non-deterministic, depending on the scheduling of gc. But this
non-determinism is non-observable. WeakMap.contains would make it
observable.

a) this concise elaboration should be part of the spec, to reduce
   guessing about the design intentions

b) there is at least one use case where observing gc would be
useful: instrumenting code for heap profiling; since built-in heap profiling is supported in too few JS debuggers atm, I was wondering whether there could be some reflection-
   level language support for "this object is no longer referenced",
perhaps as an iterator for WeakMap; then tool builders could use that, and standard users would be aware that this isn't a
   normal-level feature.

Claus

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to