-
-
Notifications
You must be signed in to change notification settings - Fork 34k
util: limit inspect to only show own properties #61032
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
base: main
Are you sure you want to change the base?
util: limit inspect to only show own properties #61032
Conversation
Error's cause and errors properties would be visible even if these were not own properties. This is changed to align with all other parts of the inspect handling. As drive-by I changed an array to a set for faster lookup in assert. Fixes: nodejs#60717 Closes: nodejs#60724
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61032 +/- ##
==========================================
- Coverage 88.52% 88.52% -0.01%
==========================================
Files 703 703
Lines 208538 208539 +1
Branches 40214 40220 +6
==========================================
- Hits 184615 184611 -4
- Misses 15921 15950 +29
+ Partials 8002 7978 -24
🚀 New features to boost your workflow:
|
| const kMaxLongStringLength = 512; | ||
|
|
||
| const kMethodsWithCustomMessageDiff = ['deepStrictEqual', 'strictEqual', 'partialDeepStrictEqual']; | ||
| const kMethodsWithCustomMessageDiff = new SafeSet(['deepStrictEqual', 'strictEqual', 'partialDeepStrictEqual']); |
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.
That seems unrelated
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.
See PR description
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.
It should its own PR IMO, as is it makes the git blame harder to use, and so it can be reverted / benchmarked on its own if need be
Error's cause and errors properties would be visible even if these were not own properties. This is changed to align with all other parts of the inspect handling.
As drive-by I changed an array to a set for faster lookup in assert.
Fixes: #60717
Closes: #60724