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

Function processQueue

test/angular/1.3/angular.js:13307–13329  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

13305 }
13306
13307 function processQueue(state) {
13308 var fn, promise, pending;
13309
13310 pending = state.pending;
13311 state.processScheduled = false;
13312 state.pending = undefined;
13313 for (var i = 0, ii = pending.length; i < ii; ++i) {
13314 promise = pending[i][0];
13315 fn = pending[i][state.status];
13316 try {
13317 if (isFunction(fn)) {
13318 promise.resolve(fn(state.value));
13319 } else if (state.status === 1) {
13320 promise.resolve(state.value);
13321 } else {
13322 promise.reject(state.value);
13323 }
13324 } catch (e) {
13325 promise.reject(e);
13326 exceptionHandler(e);
13327 }
13328 }
13329 }
13330
13331 function scheduleProcessQueue(state) {
13332 if (state.processScheduled || !state.pending) return;

Callers 1

scheduleProcessQueueFunction · 0.70

Calls 2

fnFunction · 0.85
isFunctionFunction · 0.70

Tested by

no test coverage detected