Correct the type of return value of FinalizationRegistry.unregister (#57948)

This commit is contained in:
James Lan 2024-04-18 15:45:47 -07:00 committed by GitHub
parent 05f4dbab10
commit e33b8d9b85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 19 deletions

View File

@ -42,7 +42,7 @@ interface FinalizationRegistry<T> {
* @param unregisterToken The token that was used as the unregisterToken argument when calling
* register to register the target value.
*/
unregister(unregisterToken: WeakKey): void;
unregister(unregisterToken: WeakKey): boolean;
}
interface FinalizationRegistryConstructor {

View File

@ -168,14 +168,14 @@ f.register(s, null);
> : ^^^^^^
f.unregister(s);
>f.unregister(s) : void
> : ^^^^
>f.unregister : (unregisterToken: WeakKey) => void
> : ^ ^^ ^^^^^^^^^
>f.unregister(s) : boolean
> : ^^^^^^^
>f.unregister : (unregisterToken: WeakKey) => boolean
> : ^ ^^ ^^^^^^^^^^^^
>f : FinalizationRegistry<unknown>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>unregister : (unregisterToken: WeakKey) => void
> : ^ ^^ ^^^^^^^^^
>unregister : (unregisterToken: WeakKey) => boolean
> : ^ ^^ ^^^^^^^^^^^^
>s : symbol
> : ^^^^^^

View File

@ -168,14 +168,14 @@ f.register(s, null);
> : ^^^^^^
f.unregister(s);
>f.unregister(s) : void
> : ^^^^
>f.unregister : (unregisterToken: WeakKey) => void
> : ^ ^^ ^^^^^^^^^
>f.unregister(s) : boolean
> : ^^^^^^^
>f.unregister : (unregisterToken: WeakKey) => boolean
> : ^ ^^ ^^^^^^^^^^^^
>f : FinalizationRegistry<unknown>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>unregister : (unregisterToken: WeakKey) => void
> : ^ ^^ ^^^^^^^^^
>unregister : (unregisterToken: WeakKey) => boolean
> : ^ ^^ ^^^^^^^^^^^^
>s : symbol
> : ^^^^^^

View File

@ -357,16 +357,16 @@ export class IterableWeakMap<K extends object, V> implements WeakMap<K, V> {
> : ^^^^^^^^^^
this.#finalizationGroup.unregister(ref);
>this.#finalizationGroup.unregister(ref) : void
> : ^^^^
>this.#finalizationGroup.unregister : (unregisterToken: WeakKey) => void
> : ^ ^^ ^^^^^^^^^
>this.#finalizationGroup.unregister(ref) : boolean
> : ^^^^^^^
>this.#finalizationGroup.unregister : (unregisterToken: WeakKey) => boolean
> : ^ ^^ ^^^^^^^^^^^^
>this.#finalizationGroup : FinalizationRegistry<{ readonly ref: WeakRef<object>; readonly set: Set<WeakRef<object>>; }>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>this : this
> : ^^^^
>unregister : (unregisterToken: WeakKey) => void
> : ^ ^^ ^^^^^^^^^
>unregister : (unregisterToken: WeakKey) => boolean
> : ^ ^^ ^^^^^^^^^^^^
>ref : WeakRef<K>
> : ^^^^^^^^^^