-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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 inspect #20802
util: improve inspect #20802
Conversation
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 as semver-major
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
Would be curious to see CITGM results as I could see this impacting test suites. (But maybe not?) |
@addaleax about this being semver-major: we actually have the following in our docs:
So I personally do not think this is semver-major. When added, it was somewhat meant for changes like these as far as I can tell. |
@BridgeAR Yes, this is definitely in the “erring on the side of caution” category. I know that people shouldn’t depend on it, but I’m not sure this change is trivial enough to have a reasonable expectation that it doesn’t break people’s code. If there is a good reason for this not being semver-major (as in, a significant advantage for us), we can remove the label. CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1418/ |
This aligns the visualization of an error with no stack traces set to zero just as it is done in case the error has no stack trace.
When inspecting nested objects some times a whitespace was added at the end of a line. This fixes this erroneous space. Besides that the `breakLength` was not followed if a single property was longer than the breakLength. It will now break a single property into the key and value in such cases.
Error stacks and multiline error messages were not correct indented. This is fixed by this patch.
When inspecting errors with extra properties while setting the compact option to false, it will now return: [Error: foo] { at repl:1:5 at Script.runInThisContext (vm.js:89:20) bla: true } Instead of: Error: foo at repl:1:5 at Script.runInThisContext (vm.js:91:20) { bla: true }
04c0c48
to
9c1d559
Compare
Rebased due to conflicts. New CI https://ci.nodejs.org/job/node-test-pull-request/14988/ Since the conflicts required some more work, PTAL. @addaleax one main benefit would be easier backports. |
As a note: nothing seem to show up on CITGM. |
Still LGTM |
This aligns the visualization of an error with no stack traces set to zero just as it is done in case the error has no stack trace. PR-URL: nodejs#20802 Refs: nodejs#20253 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
When inspecting nested objects some times a whitespace was added at the end of a line. This fixes this erroneous space. Besides that the `breakLength` was not followed if a single property was longer than the breakLength. It will now break a single property into the key and value in such cases. PR-URL: nodejs#20802 Refs: nodejs#20253 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Error stacks and multiline error messages were not correct indented. This is fixed by this patch. PR-URL: nodejs#20802 Refs: nodejs#20253 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
When inspecting errors with extra properties while setting the compact option to false, it will now return: [Error: foo] { at repl:1:5 at Script.runInThisContext (vm.js:89:20) bla: true } Instead of: Error: foo at repl:1:5 at Script.runInThisContext (vm.js:91:20) { bla: true } PR-URL: nodejs#20802 Refs: nodejs#20253 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Thanks. Landed in 7f0f978...c041a2e 🎉 |
@addaleax I still think it would be best not to have this as semver-major. |
@BridgeAR If you feel strongly about this, you can remove the label… I don’t think this is something we’d want to backport to an LTS line, though |
Please check the commit messages for the details.
Refs: #20253
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes