util: canonicalize namespaced tags in inspect()#63257
Open
Renegade334 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63257 +/- ##
=======================================
Coverage 90.03% 90.04%
=======================================
Files 713 713
Lines 224950 224945 -5
Branches 42531 42530 -1
=======================================
+ Hits 202527 202541 +14
+ Misses 14218 14187 -31
- Partials 8205 8217 +12
🚀 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.
Precursor to adding support for Temporal objects in #63154.
Namespaced toString tags are becoming more common in ES builtins.
inspect()currently has no logic for dealing with these, leading to rather ugly output:This PR adds logic to handle namespaced tags. If the basename of the namespaced tag matches the constructor name, then it will be treated as the canonical name for that object. Derived classes retain the same behaviour as exists currently.
Note that this replaces, and effectively reverts, some previous logic that existed here from #59687. That PR made partial string tag matches be considered hits, so
FooBarBazwould matchFooand suppress the additional tag output. This logic doesn't really fit with namespaced tags, and I think the easiest approach is just to replace it entirely. (cc @BridgeAR, @miguelmarcondesf)