Repository navigation
util: use internal hexSlice directly in util.inspect() - #66974
Open
LiviaMedeiros wants to merge 2 commits into
Open
LiviaMedeiros wants to merge 2 commits into
LiviaMedeiros wants to merge 2 commits into
Conversation
Signed-off-by: LiviaMedeiros <[email protected]>
Signed-off-by: LiviaMedeiros <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66974 +/- ##
==========================================
- Coverage 92.93% 90.58% -2.35%
==========================================
Files 428 797 +369
Lines 195236 278299 +83063
Branches 30183 53519 +23336
==========================================
+ Hits 181442 252109 +70667
- Misses 13467 16562 +3095
- Partials 327 9628 +9301
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hexSlice, used byutil.inspectto formatArrayBuffers, is used in a quite roundabout way: it's wrapped in a function to be set onBuffer.prototype, gets lazily retrieved from the userland-facing prototype, and then uncurried. As a side effect, it's prone to prototype pollution at any moment before a buffer gets inspected.It would be more straightforward to export it from
internal/bufferand use directly.I'm not sure why it was added with lazy-loading (cc @BridgeAR). If there is a strong reason for that, we can lazy-load it from
internal/bufferin the same way.