MCPcopy Index your code
hub / github.com/angular-ui/ui-router / processQueue

Function processQueue

test/angular/1.6/angular.js:17317–17350  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

17315 });
17316
17317 function processQueue(state) {
17318 var fn, promise, pending;
17319
17320 pending = state.pending;
17321 state.processScheduled = false;
17322 state.pending = undefined;
17323 try {
17324 for (var i = 0, ii = pending.length; i < ii; ++i) {
17325 markQStateExceptionHandled(state);
17326 promise = pending[i][0];
17327 fn = pending[i][state.status];
17328 try {
17329 if (isFunction(fn)) {
17330 resolvePromise(promise, fn(state.value));
17331 } else if (state.status === 1) {
17332 resolvePromise(promise, state.value);
17333 } else {
17334 rejectPromise(promise, state.value);
17335 }
17336 } catch (e) {
17337 rejectPromise(promise, e);
17338 // This error is explicitly marked for being passed to the $exceptionHandler
17339 if (e && e.$$passToExceptionHandler === true) {
17340 exceptionHandler(e);
17341 }
17342 }
17343 }
17344 } finally {
17345 --queueSize;
17346 if (errorOnUnhandledRejections && queueSize === 0) {
17347 nextTick(processChecks);
17348 }
17349 }
17350 }
17351
17352 function processChecks() {
17353 // eslint-disable-next-line no-unmodified-loop-condition

Callers 1

scheduleProcessQueueFunction · 0.70

Calls 6

fnFunction · 0.85
isFunctionFunction · 0.70
resolvePromiseFunction · 0.70
rejectPromiseFunction · 0.70
nextTickFunction · 0.70

Tested by

no test coverage detected