MCPcopy Index your code
hub / github.com/angular/angular / finally

Method finally

packages/zone.js/lib/common/promise.ts:560–575  ·  view source on GitHub ↗
(onFinally?: () => U | PromiseLike<U>)

Source from the content-addressed store, hash-verified

558 }
559
560 finally<U>(onFinally?: () => U | PromiseLike<U>): Promise<R> {
561 // See comment on the call to `then` about why thee `Symbol.species` is safely accessed.
562 let C = (this.constructor as any)?.[Symbol.species];
563 if (!C || typeof C !== 'function') {
564 C = ZoneAwarePromise;
565 }
566 const chainPromise: Promise<R | never> = new (C as typeof ZoneAwarePromise)(noop);
567 (chainPromise as any)[symbolFinally] = symbolFinally;
568 const zone = Zone.current;
569 if ((this as any)[symbolState] == UNRESOLVED) {
570 (<any[]>(this as any)[symbolValue]).push(zone, chainPromise, onFinally, onFinally);
571 } else {
572 scheduleResolveOrReject(this, zone, chainPromise as any, onFinally, onFinally);
573 }
574 return chainPromise;
575 }
576 }
577 // Protect against aggressive optimizers dropping seemingly unused properties.
578 // E.g. Closure Compiler in advanced mode.

Callers 11

checkForUpdateMethod · 0.80
runMethod · 0.80
bootstrapFunction · 0.80
whenStableMethod · 0.80
whenStableWithTimeoutFunction · 0.80
triggerResourceLoadingFunction · 0.80
patchFetchFunction · 0.80
bluebird.spec.tsFile · 0.80
Promise.spec.tsFile · 0.80

Calls 2

scheduleResolveOrRejectFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected