MCPcopy
hub / github.com/angular-ui/ui-router / processQueue

Function processQueue

test/angular/1.7/angular.js:17935–17968  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

17933 });
17934
17935 function processQueue(state) {
17936 var fn, promise, pending;
17937
17938 pending = state.pending;
17939 state.processScheduled = false;
17940 state.pending = undefined;
17941 try {
17942 for (var i = 0, ii = pending.length; i < ii; ++i) {
17943 markQStateExceptionHandled(state);
17944 promise = pending[i][0];
17945 fn = pending[i][state.status];
17946 try {
17947 if (isFunction(fn)) {
17948 resolvePromise(promise, fn(state.value));
17949 } else if (state.status === 1) {
17950 resolvePromise(promise, state.value);
17951 } else {
17952 rejectPromise(promise, state.value);
17953 }
17954 } catch (e) {
17955 rejectPromise(promise, e);
17956 // This error is explicitly marked for being passed to the $exceptionHandler
17957 if (e && e.$$passToExceptionHandler === true) {
17958 exceptionHandler(e);
17959 }
17960 }
17961 }
17962 } finally {
17963 --queueSize;
17964 if (errorOnUnhandledRejections && queueSize === 0) {
17965 nextTick(processChecks);
17966 }
17967 }
17968 }
17969
17970 function processChecks() {
17971 // 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