-
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
> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
The first step in the algorithm in the spec section you link to is to convert
key
to 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
key
should be converted to a string.