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

Different behavior of { a: 1 } in the REPL and the debugger #46808

Open
tuannd89 opened this issue Feb 24, 2023 · 4 comments · May be fixed by #46924
Open

Different behavior of { a: 1 } in the REPL and the debugger #46808

tuannd89 opened this issue Feb 24, 2023 · 4 comments · May be fixed by #46924
Labels
debugger Issues and PRs related to the debugger subsystem. repl Issues and PRs related to the REPL subsystem.

Comments

@tuannd89
Copy link

Version

v19.7.0

Platform

No response

Subsystem

No response

What steps will reproduce the bug?

Evaluating { a: 1 } in the REPL and the debugger have different result

% node
> { a: 1 }
{ a: 1 }
% node inspect app.js
debug> { a: 1 }
1

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

Always

What is the expected behavior?

Like REPL, the result of debugger will be

% node inspect app.js
debug> { a: 1 }
{ a: 1 }

What do you see instead?

% node inspect app.js
debug> { a: 1 }
1

Additional information

The results of { a: 1 } in other runtimes:

  • ChromeDevTools: { a: 1 }

  • Safari WebInspector: { a: 1 }

We have a similar bug (#45964) but we have not fixed yet and it was closed

@cola119 cola119 added the debugger Issues and PRs related to the debugger subsystem. label Feb 24, 2023
@bnoordhuis
Copy link
Member

We have a similar bug (#45964) but we have not fixed yet and it was closed

That's because it's not considered a bug but working as expected, it's a deliberate choice. Thanks for the report but I'm going to go ahead and close it.

@bnoordhuis bnoordhuis closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2023
@bnoordhuis bnoordhuis added repl Issues and PRs related to the REPL subsystem. and removed debugger Issues and PRs related to the debugger subsystem. labels Feb 24, 2023
@cola119
Copy link
Member

cola119 commented Feb 27, 2023

@bnoordhuis We reached the consensus that it's not a bug, so the node inspect REPL should have the same behavior.

Current:

% node
> { a: 1 }
{ a: 1 }

% node inspect app.js
debug> { a: 1 }
1

Expected:

% node
> { a: 1 }
{ a: 1 }

% node inspect app.js
debug> { a: 1 }
{ a: 1 }

@cola119 cola119 reopened this Feb 27, 2023
@cola119 cola119 added the debugger Issues and PRs related to the debugger subsystem. label Feb 27, 2023
@bnoordhuis
Copy link
Member

@cola119 who is "we"?

@cola119
Copy link
Member

cola119 commented Feb 27, 2023

I meant that we have reached the consensus that the REPL's evaluation of {a: 1} as {a: 1} instead of 1 is not a bug, so node inspect's REPL should behave in the same way.

meixg added a commit to meixg/node that referenced this issue Mar 3, 2023
meixg added a commit to meixg/node that referenced this issue Mar 3, 2023
meixg added a commit to meixg/node that referenced this issue Apr 24, 2024
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. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants