-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Non-registered symbols are treated as invalid weak map key #49135
Comments
This is not working on v19.7 since it is a (rather) new addition to TC39: https://github.com/tc39/proposal-symbols-as-weakmap-keys Node v19.7 uses v8 Also worth noting that v19.x is EOL and you might want to consider upgrading to v20: https://github.com/nodejs/release |
👍 I upgraded to NodeJS v20.5.1 and confirm the script is working as intended. Marking this issue as closed. |
According to nodejs/node#49135 this support was added in 20.1.0.
* Update WeakMap.json NodeJS symbol_as_keys According to nodejs/node#49135 this support was added in 20.1.0. * Update WeakMap.json use the first version of Node that's in the list * Update nodejs.json Add 20.1.0 * Use 20.1.0 --------- Co-authored-by: Florian Scholz <fs@florianscholz.com>
Version
v19.7.0
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
Refering to MDN documentation:
A WeakMap is a collection of key/value pairs whose keys must be objects or
non-registered symbols
, with values of any arbitrary JavaScript type, and which does not create strong references to its keys.Emphasis on
non-registered symbols
. NodeJS gives TypeError: Invalid value used as weak map key whennon-registered symbols
are used as keys for WeakMap entries.What do you see instead?
Additional information
Works without error on web browsers (tested on Chrome, Edge)
The text was updated successfully, but these errors were encountered: