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

Function processQueue

lib/test/angular/1.8.0/angular.js:18000–18033  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

17998 });
17999
18000 function processQueue(state) {
18001 var fn, promise, pending;
18002
18003 pending = state.pending;
18004 state.processScheduled = false;
18005 state.pending = undefined;
18006 try {
18007 for (var i = 0, ii = pending.length; i < ii; ++i) {
18008 markQStateExceptionHandled(state);
18009 promise = pending[i][0];
18010 fn = pending[i][state.status];
18011 try {
18012 if (isFunction(fn)) {
18013 resolvePromise(promise, fn(state.value));
18014 } else if (state.status === 1) {
18015 resolvePromise(promise, state.value);
18016 } else {
18017 rejectPromise(promise, state.value);
18018 }
18019 } catch (e) {
18020 rejectPromise(promise, e);
18021 // This error is explicitly marked for being passed to the $exceptionHandler
18022 if (e && e.$$passToExceptionHandler === true) {
18023 exceptionHandler(e);
18024 }
18025 }
18026 }
18027 } finally {
18028 --queueSize;
18029 if (errorOnUnhandledRejections && queueSize === 0) {
18030 nextTick(processChecks);
18031 }
18032 }
18033 }
18034
18035 function processChecks() {
18036 // 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