5
5
* Use of this source code is governed by an MIT-style license that can be
6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
- interface Promise < T > {
9
- finally < U > ( onFinally ?: ( ) => U | PromiseLike < U > ) : Promise < T > ;
10
- }
11
-
12
8
Zone . __load_patch ( 'ZoneAwarePromise' , ( global : any , Zone : ZoneType , api : _ZonePrivate ) => {
13
9
const ObjectGetOwnPropertyDescriptor = Object . getOwnPropertyDescriptor ;
14
10
const ObjectDefineProperty = Object . defineProperty ;
@@ -146,7 +142,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
146
142
if ( state !== REJECTED && value instanceof ZoneAwarePromise &&
147
143
value . hasOwnProperty ( symbolState ) && value . hasOwnProperty ( symbolValue ) &&
148
144
( value as any ) [ symbolState ] !== UNRESOLVED ) {
149
- clearRejectedNoCatch ( < Promise < any > > value ) ;
145
+ clearRejectedNoCatch ( < Promise < any > > value as any ) ;
150
146
resolvePromise ( promise , ( value as any ) [ symbolState ] , ( value as any ) [ symbolValue ] ) ;
151
147
} else if ( state !== REJECTED && typeof then === 'function' ) {
152
148
try {
@@ -379,7 +375,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
379
375
if ( ( this as any ) [ symbolState ] == UNRESOLVED ) {
380
376
( < any [ ] > ( this as any ) [ symbolValue ] ) . push ( zone , chainPromise , onFulfilled , onRejected ) ;
381
377
} else {
382
- scheduleResolveOrReject ( this , zone , chainPromise , onFulfilled , onRejected ) ;
378
+ scheduleResolveOrReject ( this , zone , chainPromise as any , onFulfilled , onRejected ) ;
383
379
}
384
380
return chainPromise ;
385
381
}
@@ -397,7 +393,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
397
393
if ( ( this as any ) [ symbolState ] == UNRESOLVED ) {
398
394
( < any [ ] > ( this as any ) [ symbolValue ] ) . push ( zone , chainPromise , onFinally , onFinally ) ;
399
395
} else {
400
- scheduleResolveOrReject ( this , zone , chainPromise , onFinally , onFinally ) ;
396
+ scheduleResolveOrReject ( this , zone , chainPromise as any , onFinally , onFinally ) ;
401
397
}
402
398
return chainPromise ;
403
399
}
0 commit comments