This repository was archived by the owner on Jan 25, 2022. It is now read-only.
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
Iterable WeakMap implementation in README is incorrect? #213
Open
Description
See discussion here: nodejs/node#35915 (comment)
The set
implementation always creates a new WeakRef which means that set
ing the same thing twice sets two keys since:
var m = new Map();
var o = {};
var r1 = new WeakRef(o);
var r2 = new WeakRef(o);
m.set(r1, "foo");
console.log(m.get(r1)); // foo
console.log(m.get(r2)); // undefined
cc @bcoe
Metadata
Metadata
Assignees
Labels
No labels