diff --git a/src/internal/util/ArgumentOutOfRangeError.ts b/src/internal/util/ArgumentOutOfRangeError.ts index b9bd72d1d1..983ce709aa 100644 --- a/src/internal/util/ArgumentOutOfRangeError.ts +++ b/src/internal/util/ArgumentOutOfRangeError.ts @@ -6,7 +6,7 @@ export interface ArgumentOutOfRangeErrorCtor { } const ArgumentOutOfRangeErrorImpl = (() => { - function ArgumentOutOfRangeErrorImpl(this: any) { + function ArgumentOutOfRangeErrorImpl(this: Error) { Error.call(this); this.message = 'argument out of range'; this.name = 'ArgumentOutOfRangeError'; diff --git a/src/internal/util/EmptyError.ts b/src/internal/util/EmptyError.ts index 6eb1d0761d..f760908378 100644 --- a/src/internal/util/EmptyError.ts +++ b/src/internal/util/EmptyError.ts @@ -6,7 +6,7 @@ export interface EmptyErrorCtor { } const EmptyErrorImpl = (() => { - function EmptyErrorImpl(this: any) { + function EmptyErrorImpl(this: Error) { Error.call(this); this.message = 'no elements in sequence'; this.name = 'EmptyError'; diff --git a/src/internal/util/ObjectUnsubscribedError.ts b/src/internal/util/ObjectUnsubscribedError.ts index 45d2066445..1d603e4cff 100644 --- a/src/internal/util/ObjectUnsubscribedError.ts +++ b/src/internal/util/ObjectUnsubscribedError.ts @@ -6,7 +6,7 @@ export interface ObjectUnsubscribedErrorCtor { } const ObjectUnsubscribedErrorImpl = (() => { - function ObjectUnsubscribedErrorImpl(this: any) { + function ObjectUnsubscribedErrorImpl(this: Error) { Error.call(this); this.message = 'object unsubscribed'; this.name = 'ObjectUnsubscribedError'; diff --git a/src/internal/util/TimeoutError.ts b/src/internal/util/TimeoutError.ts index fd0ae50257..0e3cc95604 100644 --- a/src/internal/util/TimeoutError.ts +++ b/src/internal/util/TimeoutError.ts @@ -6,7 +6,7 @@ export interface TimeoutErrorCtor { } const TimeoutErrorImpl = (() => { - function TimeoutErrorImpl(this: any) { + function TimeoutErrorImpl(this: Error) { Error.call(this); this.message = 'Timeout has occurred'; this.name = 'TimeoutError'; diff --git a/src/internal/util/UnsubscriptionError.ts b/src/internal/util/UnsubscriptionError.ts index 02f1a0d8ec..1e1e9ed788 100644 --- a/src/internal/util/UnsubscriptionError.ts +++ b/src/internal/util/UnsubscriptionError.ts @@ -7,13 +7,13 @@ export interface UnsubscriptionErrorCtor { } const UnsubscriptionErrorImpl = (() => { - function UnsubscriptionErrorImpl(this: any, errors: any[]) { + function UnsubscriptionErrorImpl(this: Error, errors: (Error|string)[]) { Error.call(this); this.message = errors ? `${errors.length} errors occurred during unsubscription: ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : ''; this.name = 'UnsubscriptionError'; - this.errors = errors; + (this as any).errors = errors; return this; } @@ -26,4 +26,4 @@ ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : ''; * An error thrown when one or more errors have occurred during the * `unsubscribe` of a {@link Subscription}. */ -export const UnsubscriptionError: UnsubscriptionErrorCtor = UnsubscriptionErrorImpl as any; \ No newline at end of file +export const UnsubscriptionError: UnsubscriptionErrorCtor = UnsubscriptionErrorImpl as any;