diff --git a/src/Subscriber.ts b/src/Subscriber.ts index 7db085f767..955b30a55b 100644 --- a/src/Subscriber.ts +++ b/src/Subscriber.ts @@ -1,6 +1,5 @@ import {noop} from './util/noop'; import {throwError} from './util/throwError'; -import {tryOrOnError} from './util/tryOrOnError'; import {tryOrThrowError} from './util/tryOrThrowError'; import {Observer} from './Observer'; @@ -88,7 +87,7 @@ class SafeSubscriber extends Subscriber { error?: (e?: any) => void, complete?: () => void) { super(); - this._next = (typeof next === 'function') && tryOrOnError(next) || null; + this._next = (typeof next === 'function') && tryOrThrowError(next) || null; this._error = (typeof error === 'function') && tryOrThrowError(error) || throwError; this._complete = (typeof complete === 'function') && tryOrThrowError(complete) || null; } diff --git a/src/util/tryOrOnError.ts b/src/util/tryOrOnError.ts deleted file mode 100644 index b95669a7a5..0000000000 --- a/src/util/tryOrOnError.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function tryOrOnError(target: Function): (x?: any) => any { - function tryCatcher() { - try { - ( tryCatcher).target.apply(this, arguments); - } catch (e) { - this.error(e); - } - } - ( tryCatcher).target = target; - return tryCatcher; -}