function f() {
const w = new WeakMap();
const o = {};
w.set(o, { v: o });
return w;
}
const weakMap = f();
For the given code, would the only weakMap
item considered as reachable or not? Hence, will it be garbage collected or not?
PS: This question is asked from the perspective of the specification, not particular implementations.