Skip to content

Un-consolidate overloads for Map and WeakMap - #28052

Merged
1 commit merged into
masterfrom
mapsetoverloads
Oct 22, 2018
Merged

1 commit merged into
masterfrom
mapsetoverloads

Conversation

@ghost

Copy link
Copy Markdown

Fixes #27951


interface WeakMapConstructor {
new <K extends object = object, V = any>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;

@ExE-Boss ExE Boss (ExE-Boss) Nov 22, 2020 •

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.

Because this PR only changed this WeakMap constructor overload, #23551 has resurfaced once again, and the following is still valid:

new WeakMap<object>();

I’m fixing that in #41635 #56713.

@@ -0,0 +1,2 @@
// @lib: es6
new Map<string>();

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.

This should’ve also had a test case for:

new WeakMap<object>();

I’m fixing that in #41635.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants