-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed as not planned
Closed as not planned
Copy link
Labels
Not a DefectThis behavior is one of several equally-correct optionsThis behavior is one of several equally-correct options
Description
lib Update Request
Configuration Check
My compilation target is ES2015 and my lib is es2021.
Missing / Incorrect Definition
The es2015.iterable type definitions for WeakMap and WeakSet's ctors are missing undefined and null, contrary to the weakmap spec and the weakset spec:
- If iterable is either undefined or null, return map.
- If iterable is either undefined or null, return set.
TypeScript/src/lib/es2015.iterable.d.ts
Lines 146 to 148 in 03951f2
| interface WeakMapConstructor { | |
| new <K extends WeakKey, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>; | |
| } |
TypeScript/src/lib/es2015.iterable.d.ts
Lines 194 to 196 in 03951f2
| interface WeakSetConstructor { | |
| new <T extends WeakKey = WeakKey>(iterable: Iterable<T>): WeakSet<T>; | |
| } |
The (non-weak) Map ctor was made optional/nullable in this PR from 2021 - I assume that WeakMap/WeakSet was missed as an oversight.
I began to address this issue in this branch, but the PR template required an issue so here I am :)
Metadata
Metadata
Assignees
Labels
Not a DefectThis behavior is one of several equally-correct optionsThis behavior is one of several equally-correct options