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

Function processQueue

lib/test/angular/1.7.0/angular.js:17361–17394  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

17359 });
17360
17361 function processQueue(state) {
17362 var fn, promise, pending;
17363
17364 pending = state.pending;
17365 state.processScheduled = false;
17366 state.pending = undefined;
17367 try {
17368 for (var i = 0, ii = pending.length; i < ii; ++i) {
17369 markQStateExceptionHandled(state);
17370 promise = pending[i][0];
17371 fn = pending[i][state.status];
17372 try {
17373 if (isFunction(fn)) {
17374 resolvePromise(promise, fn(state.value));
17375 } else if (state.status === 1) {
17376 resolvePromise(promise, state.value);
17377 } else {
17378 rejectPromise(promise, state.value);
17379 }
17380 } catch (e) {
17381 rejectPromise(promise, e);
17382 // This error is explicitly marked for being passed to the $exceptionHandler
17383 if (e && e.$$passToExceptionHandler === true) {
17384 exceptionHandler(e);
17385 }
17386 }
17387 }
17388 } finally {
17389 --queueSize;
17390 if (errorOnUnhandledRejections && queueSize === 0) {
17391 nextTick(processChecks);
17392 }
17393 }
17394 }
17395
17396 function processChecks() {
17397 // eslint-disable-next-line no-unmodified-loop-condition

Callers 1

scheduleProcessQueueFunction · 0.70

Calls 6

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

Tested by

no test coverage detected