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

util,errors: make display of errors consistent with browsers #15765

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Oct 4, 2017

In Chrome, adding or mutating properties does not change the output of
Error objects displayed via console.log() etc. This change
replicates that behavior in Node.js.

This is blocked until #15694 lands as some of the changes depend on that PR.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

util tests

@Trott Trott added blocked PRs that are blocked by other issues or PRs. errors Issues and PRs related to JavaScript errors originated in Node.js core. util Issues and PRs related to the built-in util module. labels Oct 4, 2017
@nodejs-github-bot nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. util Issues and PRs related to the built-in util module. labels Oct 4, 2017
@Trott Trott force-pushed the fix-util-with-errors branch from 3455348 to de0fc0b Compare October 4, 2017 02:47
In Chrome, adding or mutating properties does not change the output of
`Error` objects displayed via `console.log()` etc. This change
replicates that behavior in Node.js.
@Trott Trott force-pushed the fix-util-with-errors branch from de0fc0b to a59664a Compare October 5, 2017 00:08
@Trott Trott removed the blocked PRs that are blocked by other issues or PRs. label Oct 5, 2017
@Trott
Copy link
Member Author

Trott commented Oct 5, 2017

#15694 landed so this is now unblocked.

@Trott Trott added the wip Issues and PRs that are still a work in progress. label Oct 5, 2017
@Trott
Copy link
Member Author

Trott commented Oct 5, 2017

Labeled as in progress because there are behaviors that are different from browser.

@Trott
Copy link
Member Author

Trott commented Oct 5, 2017

I'm going to close this pull request. Firefox behaves differently than Chrome. In Firefox, if you change the name property, console.log() will use the new name unlike Chrome. I don't know that Node.js should emulate browser console behavior if the major browsers are inconsistent.

@Trott Trott closed this Oct 5, 2017
@Trott Trott deleted the fix-util-with-errors branch January 13, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. util Issues and PRs related to the built-in util module. wip Issues and PRs that are still a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants