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

Function processQueue

lib/test/angular/1.6.7/angular.js:17132–17165  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

17130 });
17131
17132 function processQueue(state) {
17133 var fn, promise, pending;
17134
17135 pending = state.pending;
17136 state.processScheduled = false;
17137 state.pending = undefined;
17138 try {
17139 for (var i = 0, ii = pending.length; i < ii; ++i) {
17140 markQStateExceptionHandled(state);
17141 promise = pending[i][0];
17142 fn = pending[i][state.status];
17143 try {
17144 if (isFunction(fn)) {
17145 resolvePromise(promise, fn(state.value));
17146 } else if (state.status === 1) {
17147 resolvePromise(promise, state.value);
17148 } else {
17149 rejectPromise(promise, state.value);
17150 }
17151 } catch (e) {
17152 rejectPromise(promise, e);
17153 // This error is explicitly marked for being passed to the $exceptionHandler
17154 if (e && e.$$passToExceptionHandler === true) {
17155 exceptionHandler(e);
17156 }
17157 }
17158 }
17159 } finally {
17160 --queueSize;
17161 if (errorOnUnhandledRejections && queueSize === 0) {
17162 nextTick(processChecks);
17163 }
17164 }
17165 }
17166
17167 function processChecks() {
17168 // eslint-disable-next-line no-unmodified-loop-condition

Callers 1

scheduleProcessQueueFunction · 0.70

Calls 6

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

Tested by

no test coverage detected