MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / resolvePromise

Function resolvePromise

web/static/bower_components/angular/angular.js:10554–10565  ·  view source on GitHub ↗

* Resolves the raw $http promise.

(response, status, headers, statusText)

Source from the content-addressed store, hash-verified

10552 * Resolves the raw $http promise.
10553 */
10554 function resolvePromise(response, status, headers, statusText) {
10555 //status: HTTP response status code, 0, -1 (aborted by timeout / promise)
10556 status = status >= -1 ? status : 0;
10557
10558 (isSuccess(status) ? deferred.resolve : deferred.reject)({
10559 data: response,
10560 status: status,
10561 headers: headersGetter(headers),
10562 config: config,
10563 statusText: statusText
10564 });
10565 }
10566
10567 function resolvePromiseWithResult(result) {
10568 resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);

Callers 3

sendReqFunction · 0.85
resolveHttpPromiseFunction · 0.85
resolvePromiseWithResultFunction · 0.85

Calls 2

isSuccessFunction · 0.85
headersGetterFunction · 0.85

Tested by

no test coverage detected