Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

fix(promise): Update ZoneAwarePromise to better match Promise #940

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/common/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
}
}

function scheduleResolveOrReject<R, U1, U2>(
function scheduleResolveOrReject<R, U, V>(
promise: ZoneAwarePromise<any>, zone: AmbientZone, chainPromise: ZoneAwarePromise<any>,
onFulfilled?: (value: R) => U1, onRejected?: (error: any) => U2): void {
onFulfilled?: (value: R) => U, onRejected?: (error: any) => V): void {
clearRejectedNoCatch(promise);
const delegate = (promise as any)[symbolState] ?
(typeof onFulfilled === FUNCTION) ? onFulfilled : forwardResolution :
Expand Down Expand Up @@ -310,7 +310,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
onFulfilled?: ((value: R) => TResult1 | PromiseLike<TResult1>)|undefined|null,
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>)|undefined|
null): Promise<TResult1|TResult2> {
const chainPromise: Promise<TResult1|TResult2> =
const chainPromise: Promise<TResult1> =
new (this.constructor as typeof ZoneAwarePromise)(null);
const zone = Zone.current;
if ((this as any)[symbolState] == UNRESOLVED) {
Expand Down