|
Hi folks! According to the ECMA specification Welcome to Node.js v18.3.0.
Type ".help" for more information.
> function a() { console.log("a") }
undefined
> const b = Symbol.for([a, 'foo'])
undefined
> const c = Symbol.for([a, 'foo'])
undefined
> b === c
true
> |
Answered by
Trott
Jun 8, 2022
Replies: 0 comments 1 reply
|
The first step in the algorithm in the spec section you link to is to convert
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 |
0 replies
Answer selected by
Trott
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The first step in the algorithm in the spec section you link to is to convert
keyto a string value.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
keyshould be converted to a string.