Skip to content

Type definitions for 'Symbols as WeakMap keys' (#76) - #54195

Merged
Ron Buckton (rbuckton) merged 3 commits into
microsoft:mainfrom
bloomberg:le/symbol-as-weak-keys
Jun 9, 2023
Merged

Type definitions for 'Symbols as WeakMap keys' (#76)#54195
Ron Buckton (rbuckton) merged 3 commits into
microsoft:mainfrom
bloomberg:le/symbol-as-weak-keys

Conversation

@leoelm

@leoelm Leo Elmecker-Plakolm (leoelm) commented May 9, 2023

Copy link
Copy Markdown
Contributor

Fixes #52534.

Adding symbol type support to WeakMap, WeakSet, WeakRef and FinalizationRegistry.
The above has been achieved by retrospectively introducing an interface, WeakTypes used for the definition of compatible types for the above mentioned structures.

@typescript-bot TypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 9, 2023
@typescript-bot TypeScript Bot (typescript-bot) added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 9, 2023
@leoelm
Leo Elmecker-Plakolm (leoelm) marked this pull request as ready for review May 31, 2023 21:43

@rbuckton Ron Buckton (rbuckton) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can re-review and merge once conflicts are resolved.

@leoelm

Copy link
Copy Markdown
Contributor Author

Rebase is now done and all seems to be looking good still.

Support symbols in WeakMap, WeakSet, WeakRef and FinalizationRegistry

Signed-off-by: Leo Elmecker <lelmeckerpla@bloomberg.net>
@rbuckton
Ron Buckton (rbuckton) merged commit eeed721 into microsoft:main Jun 9, 2023
interface WeakMapConstructor {
new <K extends object = object, V = any>(entries?: readonly (readonly [K, V])[] | null): WeakMap<K, V>;
readonly prototype: WeakMap<object, any>;
new <K extends WeakKey = WeakKey, V = any>(entries?: readonly [K, V][] | null): WeakMap<K, V>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regression from #50449.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for catching this. I missed it in the review.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#54592 will fix this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Type definitions for 'Symbols as WeakMap keys'

5 participants