util: inspect: enumerable Symbols no longer have square brackets#55778
util: inspect: enumerable Symbols no longer have square brackets#55778ljharb wants to merge 2 commits intonodejs:mainfrom
Conversation
|
cc @BridgeAR |
|
IMO this is a semver-major breaking change, as it breaks the existing behavior of brackets existing on all symbols |
BridgeAR
left a comment
There was a problem hiding this comment.
Generally LGTM. Please also add a few tests for the now escaped non-enumerable key names that need escaping.
I am fine to consider it as semver-major, while we normally do not handle these changes as being part of semver. The output changes from time to time and it is considered a debugging utility that does not have a stable output. I suggest to just add a few do not land labels for now and consider it a semver minor change? It could theoretically be back parted at a later point that way.
|
@ljharb I would probably just take the gist out of the discussion and use that as commit description. That way it's clear that this is done for consistency reasons to distinguish non-enumerable properties easier. |
|
@BridgeAR I've added
semver-major
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55778 +/- ##
==========================================
- Coverage 88.40% 88.40% -0.01%
==========================================
Files 654 654
Lines 187815 187810 -5
Branches 36136 36140 +4
==========================================
- Hits 166045 166035 -10
- Misses 15001 15014 +13
+ Partials 6769 6761 -8
|
8a7eda3 to
02d01fb
Compare
577b7e7 to
f4a5af6
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
Of the 2 failures, both appear to be unrelated to the PR, and seem to be issues with git itself. Can someone take a look? |
|
CI doesn't seem to be running, despite someone resuming it multiple times. Can someone look into it? |
|
It seems nodejs/build#3959 |
|
yay, all green! |
|
Landed in 9f2885a...e577618 |
PR-URL: #55778 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
Implements https://github.com/orgs/nodejs/discussions/41283#discussioncomment-11188239 PR-URL: #55778 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: nodejs#55778 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
Implements https://github.com/orgs/nodejs/discussions/41283#discussioncomment-11188239 PR-URL: nodejs#55778 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: nodejs#55778 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
Implements https://github.com/orgs/nodejs/discussions/41283#discussioncomment-11188239 PR-URL: nodejs#55778 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
The intention of this change is to increase consistency. Before this PR, non-enumerable string properties have square brackets, and all Symbol properties have square brackets - meaning that without color cues, there's no way to determine whether a Symbol is enumerable or not, and it can be confusing whether
[foo]is indeed bracketed because it's non-enumerable.Due to the following considerations:
… we decided to go with "enumerable Symbols do not have square brackets", so that all non-enumerables use square brackets.
Implements https://github.com/orgs/nodejs/discussions/41283#discussioncomment-11188239