Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent inspector output of exec new Map() #42405

Closed
cola119 opened this issue Mar 20, 2022 · 1 comment · Fixed by #42423
Closed

Inconsistent inspector output of exec new Map() #42405

cola119 opened this issue Mar 20, 2022 · 1 comment · Fixed by #42423
Labels
debugger Issues and PRs related to the debugger subsystem.

Comments

@cola119
Copy link
Member

cola119 commented Mar 20, 2022

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.

@meixg meixg added the debugger Issues and PRs related to the debugger subsystem. label Mar 20, 2022
@Trott
Copy link
Member

Trott commented Mar 20, 2022

Yeah, I think the suggested expected output would be better and would welcome a PR that changes the behavior and adds a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger Issues and PRs related to the debugger subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants