Skip to content

Symbol.for accepting string #43352

Answered by Trott
fedeci asked this question in General
Discussion options

You must be logged in to vote

The first step in the algorithm in the spec section you link to is to convert key to a string value.

  1. Let stringKey be ? ToString(key).

Symbol.for() is implemented in V8, not in Node.js code. So, if there was a bug, it needs to be opened against V8.

That said, this does not appear to be a bug. The Firefox REPL exhibits the same behavior. So does the Chrome REPL. And the spec seems to indicate that key should be converted to a string.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Trott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants