删除对象时,weakmap
保持对它的引用。
但正常的行为是:当oyu删除对象时,它会自动从weakmap中删除,weakmap不会导致内存泄漏。或
有什么问题吗?weakmap
delete
let a = { aa : { aa : 123 } };
const w = new WeakMap();
w.set(a.aa,"hello");
delete a.aa
console.log(w);// shows that '{aa:123}' is still there in weakmap
我已经关闭并打开了 devtool 并且{aa:123}
仍然存在。
期望weakmap
是空的