-
Notifications
You must be signed in to change notification settings - Fork 14
le/symbols as weak map keys #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
le/symbols as weak map keys #76
Conversation
acutmore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @leoelm this is fantastic!
I've left just a few small comments. Feel free to IB me if want to chat over any of them in person/on a call.
Also feel free to post a link to the PR in the TypeScript contributors IB pchat if you'd like to share your progress.
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
…cript into le/symbols-as-weak-map-keys
acutmore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making those extra changes. They made me notice a few other little things we can do next. Feel free to IB or put in a APPT if want to pair up on any changes.
Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
acutmore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support symbols in WeakMap, WeakSet, WeakRef and FinalizationRegistry Signed-off-by: Leo Elmecker <[email protected]>
Support symbols in WeakMap, WeakSet, WeakRef and FinalizationRegistry Signed-off-by: Leo Elmecker <[email protected]>
Support symbols in WeakMap, WeakSet, WeakRef and FinalizationRegistry Signed-off-by: Leo Elmecker <[email protected]>
Signed-off-by: Leo Elmecker <[email protected]>
Issue number of the reported bug or feature request: microsoft#52534
Describe your changes
Add type support for
symboltoWeakMap,WeakSet,WeakRefandFinalizationRegistry. This has been achieved by retrospectively introducing the interfaceWeakKeyTypesStorewhich then composes the typeWeakKeyTypes. In previous es versions this custom type will only supportobject, however expanding the interface to also supportsymbolhas been done inES2023.Testing performed
To test the feature addition,
WeakMap,WeakSet,WeakRefandFinalizationRegistryand all their member functions have been tested usingsymbolfor the relevant inputs to prove failure in versions preceding es2023 and show it to be working inES2023.