Skip to content

util: displaying non-enumerable values #4617

Closed Answered by ljharb
ljharb asked this question in Q&A
Discussion options

ljharb
Dec 22, 2021
Maintainer Sponsor

You must be logged in to vote

We discussed this at the Collab Summit this week, and due to the following considerations:

  1. minimizing disruption/changes to output
  2. square brackets are already used for a number of "special" things, including a data __proto__ property, Symbol.toStringTag values, null objects, etc, so we already wouldn't be able to have square brackets mean only "computed properties"

Therefore, let's go with "enumerable Symbols do not have square brackets", so that all non-enumerables use square brackets. (there's also another inconsistency discovered during this investigation where bracketed string keys aren't escaped the same way as unbracketed ones are, so i'll fix that as well in the same PR)

Replies: 0 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@ljharb
Comment options

ljharb Dec 22, 2021
Maintainer Author Sponsor

Comment options

You must be logged in to vote
7 replies
@ljharb
Comment options

ljharb Dec 22, 2021
Maintainer Author Sponsor

@ljharb
Comment options

ljharb Dec 24, 2021
Maintainer Author Sponsor

@ljharb
Comment options

ljharb Jan 12, 2022
Maintainer Author Sponsor

@ljharb
Comment options

ljharb Nov 8, 2024
Maintainer Author Sponsor

Answer selected by BridgeAR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants