X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Frxjs%2Fsrc%2Finternal%2FSubscription.ts;h=0c97812fec85e2d87fc23b46510571e8e4f0e0dc;hp=1a07ffa50832c644dc9828fef46bfc9224d520a5;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/Subscription.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/Subscription.ts index 1a07ffa5..0c97812f 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/Subscription.ts +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/Subscription.ts @@ -40,7 +40,8 @@ export class Subscription implements SubscriptionLike { */ constructor(unsubscribe?: () => void) { if (unsubscribe) { - ( this)._unsubscribe = unsubscribe; + (this as any)._ctorUnsubscribe = true; + (this as any)._unsubscribe = unsubscribe; } } @@ -57,7 +58,7 @@ export class Subscription implements SubscriptionLike { return; } - let { _parentOrParents, _unsubscribe, _subscriptions } = ( this); + let { _parentOrParents, _ctorUnsubscribe, _unsubscribe, _subscriptions } = (this as any); this.closed = true; this._parentOrParents = null; @@ -75,6 +76,18 @@ export class Subscription implements SubscriptionLike { } if (isFunction(_unsubscribe)) { + // It's only possible to null _unsubscribe - to release the reference to + // any teardown function passed in the constructor - if the property was + // actually assigned in the constructor, as there are some classes that + // are derived from Subscriber (which derives from Subscription) that + // implement an _unsubscribe method as a mechanism for obtaining + // unsubscription notifications and some of those subscribers are + // recycled. Also, in some of those subscribers, _unsubscribe switches + // from a prototype method to an instance property - see notifyNext in + // RetryWhenSubscriber. + if (_ctorUnsubscribe) { + (this as any)._unsubscribe = undefined; + } try { _unsubscribe.call(this); } catch (e) { @@ -131,7 +144,7 @@ export class Subscription implements SubscriptionLike { add(teardown: TeardownLogic): Subscription { let subscription = (teardown); - if (!(teardown)) { + if (!teardown) { return Subscription.EMPTY; }