Skip to content

Inconsistent inspector output of exec new Map() #42405

Closed
@cola119

Description

@cola119

Version

v17.7.2

Platform

Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64 x86_64

Subsystem

No response

What steps will reproduce the bug?

$ node inspect index.js
debug> exec new Map()
{ size: 0 }

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

The output should be the same as util.inspect(new Map()), which means

$ node inspect index.js
debug> exec new Map()
Map(0) {}

What do you see instead?

$ node inspect index.js
debug> exec new Map()
{ size: 0 }

Additional information

This is caused by RemoteObject not considering Map object (and also Set object).
https://github.com/nodejs/node/blob/master/lib/internal/debugger/inspect_repl.js#L236-L249

I'd like to send a PR that fixes this problem if ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    debuggerIssues and PRs related to the debugger subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions