Skip to content
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

See discussion here: nodejs/node#35915 (comment)

The set implementation always creates a new WeakRef which means that seting 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions