-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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: inspect: enumerable Symbols no longer have square brackets #55778
Conversation
cc @BridgeAR |
IMO this is a semver-major breaking change, as it breaks the existing behavior of brackets existing on all symbols |
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.
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 <ruben@bridgewater.de> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Implements https://github.com/orgs/nodejs/discussions/41283#discussioncomment-11188239 PR-URL: #55778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
PR-URL: nodejs#55778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Implements https://github.com/orgs/nodejs/discussions/41283#discussioncomment-11188239 PR-URL: nodejs#55778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
PR-URL: nodejs#55778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Implements https://github.com/orgs/nodejs/discussions/41283#discussioncomment-11188239 PR-URL: nodejs#55778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
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