-
Notifications
You must be signed in to change notification settings - Fork 30k
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: improve util inspect output #26984
Conversation
This fixes a proportion calculation for lots of short array entries with at least one bigger one that alone makes up for more than one fifth of all other entries together.
This makes sure that errors that contain extra properties show those properties on a separate line.
@BridgeAR Sadly, an error occurred when I tried to trigger a build. :( |
I just pushed one small commit that adds one more check to prevent unnecessary work in the default case (but no changed behavior). |
Can you please explain how this improves the output? |
@mcollina did you see the commit messages?
Without the first commit the corresponding test would just create a single Without the second commit the corresponding tests would not add a linebreak const err = new Error();
err.foo = true;
console.log(err);
// Only the last line:
// Before
// at REPLServer.Interface._line (readline.js:675:8) foo: true }
// Now
// at REPLServer.Interface._line (readline.js:675:8)
// foo: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This fixes a proportion calculation for lots of short array entries with at least one bigger one that alone makes up for more than one fifth of all other entries together. PR-URL: nodejs#26984 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This makes sure that errors that contain extra properties show those properties on a separate line. PR-URL: nodejs#26984 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This fixes a proportion calculation for lots of short array entries with at least one bigger one that alone makes up for more than one fifth of all other entries together. PR-URL: #26984 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This makes sure that errors that contain extra properties show those properties on a separate line. PR-URL: #26984 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Please have a look at the commit messages for details.
@nodejs/util PTAL
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes