Skip to content

Map.keys() returns empty object (4.1.1) #3107

Closed
@RobAtticus

Description

Calling keys() on a Map returns an empty object rather than the keys of the Map:

$ node --version
v4.1.1
$ node
> const x = new Map();
undefined
> x.set("a", 1);
Map { 'a' => 1 }
> x.keys();
{}

This works in Chrome45 which is using a similar v8 (V8 4.5.103.35):

> const x = new Map();
undefined
> x.set("a", 1);
Map {"a" => 1}
> x.keys();
MapIterator {"a"}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions