Skip to content

util: displaying non-enumerable values #41283

Answered by ljharb
ljharb asked this question in General
Discussion options

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: 2 comments 8 replies

Comment options

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

Comment options

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

@ljharb
Comment options

@ljharb
Comment options

@ljharb
Comment options

Answer selected by BridgeAR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
util Issues and PRs related to the built-in util module. discuss Issues opened for discussions and feedbacks.
2 participants