This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
Iterable WeakMap implementation in README is incorrect? #213
Open
Description
openedon Nov 3, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels