From 9309bae1bc85ceba575bfcd6f6c8e97fc694c1cf Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Mon, 25 Sep 2017 15:19:15 -0700 Subject: [PATCH] fix(Subscriber): creates subscriber throwable by default - closes #2813 --- src/Subscriber.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Subscriber.ts b/src/Subscriber.ts index 36d8459191..e33424ed3a 100644 --- a/src/Subscriber.ts +++ b/src/Subscriber.ts @@ -39,7 +39,7 @@ export class Subscriber extends Subscription implements Observer { public syncErrorValue: any = null; public syncErrorThrown: boolean = false; - public syncErrorThrowable: boolean = false; + public syncErrorThrowable: boolean = true; protected isStopped: boolean = false; protected destination: PartialObserver; // this `any` is the escape hatch to erase extra type param (e.g. R) @@ -60,10 +60,12 @@ export class Subscriber extends Subscription implements Observer { switch (arguments.length) { case 0: this.destination = emptyObserver; + this.syncErrorThrowable = false; break; case 1: if (!destinationOrNext) { this.destination = emptyObserver; + this.syncErrorThrowable = false; break; } if (typeof destinationOrNext === 'object') { @@ -71,13 +73,11 @@ export class Subscriber extends Subscription implements Observer { this.destination = (> destinationOrNext); ( this.destination).add(this); } else { - this.syncErrorThrowable = true; this.destination = new SafeSubscriber(this, > destinationOrNext); } break; } default: - this.syncErrorThrowable = true; this.destination = new SafeSubscriber(this, <((value: T) => void)> destinationOrNext, error, complete); break; }