fix(WeakMapConstructor): readonly iterable items (#43905)

like `MapConstructor`, `WeakMapConstructor` should support receiving `Iterable<readonly [K, V]>` instead of `Iterable<[K, V]>`; otherwise tuples creates with `as const`, etc. cannot be safely passed in without casts, etc.
This commit is contained in:
Mark Fulton 2021-05-20 09:18:58 -05:00 committed by GitHub
parent 4a59b63f35
commit 7901f351eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,7 @@ interface MapConstructor {
interface WeakMap<K extends object, V> { }
interface WeakMapConstructor {
new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
new <K extends object, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>;
}
interface Set<T> {