Skip to content

Commit

Permalink
fix(errors): Custom RxJS errors now all have a call stack (#5686)
Browse files Browse the repository at this point in the history
* fix(errors): Custom RxJS errors now all have a call stack

NOTE: Because we have to workaround compilation-to-ES5 inadequacies until call stack locations will show as being inside of the constructor implementation at the top level. This will go away as we move the community to ES2015+

BREAKING CHANGE: Tests that are written with naive expectations against errors may fail now that errors have a proper `stack` property. In some testing frameworks, a deep equality check on two error instances will check the values in `stack`, which could be different.

fixes #4250

* refactor: Improve error class creator

- Adds tests

* chore: update side-effects golden files

* chore: address comments

* chore: update side-effects golden files again

* chore: I hate ts-api-guardian sometimes
  • Loading branch information
benlesh authored Sep 3, 2020
1 parent fcc47e7 commit 9bb046c
Show file tree
Hide file tree
Showing 21 changed files with 844 additions and 157 deletions.
3 changes: 2 additions & 1 deletion api_guard/dist/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export declare function combineLatest<O1 extends ObservableInput<any>, O2 extend
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5, O6]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;
export declare function combineLatest<O extends ObservableInput<any>>(sources: O[]): Observable<ObservedValueOf<O>[]>;
export declare function combineLatest<O extends readonly ObservableInput<any>[]>(sources: O): Observable<ObservedValueTupleFromArray<O>>;
export declare function combineLatest<O1 extends ObservableInput<any>>(v1: O1, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>]>;
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(v1: O1, v2: O2, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;
Expand Down Expand Up @@ -405,7 +406,7 @@ export declare type ObservedValueOf<O> = O extends ObservableInput<infer T> ? T

export declare type ObservedValuesFromArray<X> = ObservedValueUnionFromArray<X>;

export declare type ObservedValueTupleFromArray<X> = X extends Array<ObservableInput<any>> ? {
export declare type ObservedValueTupleFromArray<X> = X extends readonly ObservableInput<any>[] ? {
[K in keyof X]: ObservedValueOf<X[K]>;
} : never;

Expand Down
Loading

0 comments on commit 9bb046c

Please sign in to comment.