Sha256: 5cd2839e2d54b3f5084d7045e98c4b0bcacf781f04b2fafeabf597bf937844b3

Contents?: true

Size: 1.23 KB

Versions: 21

Compression:

Stored size: 1.23 KB

Contents

"use strict";
module.exports =
    function(Promise, PromiseArray, debug) {
var PromiseInspection = Promise.PromiseInspection;
var util = require("./util");

function SettledPromiseArray(values) {
    this.constructor$(values);
}
util.inherits(SettledPromiseArray, PromiseArray);

SettledPromiseArray.prototype._promiseResolved = function (index, inspection) {
    this._values[index] = inspection;
    var totalResolved = ++this._totalResolved;
    if (totalResolved >= this._length) {
        this._resolve(this._values);
        return true;
    }
    return false;
};

SettledPromiseArray.prototype._promiseFulfilled = function (value, index) {
    var ret = new PromiseInspection();
    ret._bitField = 33554432;
    ret._settledValueField = value;
    return this._promiseResolved(index, ret);
};
SettledPromiseArray.prototype._promiseRejected = function (reason, index) {
    var ret = new PromiseInspection();
    ret._bitField = 16777216;
    ret._settledValueField = reason;
    return this._promiseResolved(index, ret);
};

Promise.settle = function (promises) {
    debug.deprecated(".settle()", ".reflect()");
    return new SettledPromiseArray(promises).promise();
};

Promise.prototype.settle = function () {
    return Promise.settle(this);
};
};

Version data entries

21 entries across 21 versions & 9 rubygems

Version Path
jester-data-8.0.0 node_modules/bluebird/js/release/settle.js
ezii-os-5.2.1 node_modules/bluebird/js/release/settle.js
ezii-os-2.0.1 node_modules/bluebird/js/release/settle.js
ezii-os-1.1.0 node_modules/bluebird/js/release/settle.js
ezii-os-1.0.0 node_modules/bluebird/js/release/settle.js
ezii-os-0.0.0.1.0 node_modules/bluebird/js/release/settle.js
ezii-os-0.0.0.0.1 node_modules/bluebird/js/release/settle.js
proxy_chain_rb-0.1.0 lib/proxy_chain_rb/node_js/proxy-chain-server/node_modules/bluebird/js/release/settle.js
browsed-0.3.1 lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js
browsed-0.3.0 lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js
browsed-0.2.9 lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js
browsed-0.2.8 lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js
browsed-0.2.7 lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js
browsed-0.2.6 lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js
optimacms-0.4.3 spec/dummy/node_modules/bluebird/js/release/settle.js
optimacms-0.4.2 spec/dummy/node_modules/bluebird/js/release/settle.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/bluebird/js/release/settle.js
locomotivecms-3.4.0 app/javascript/node_modules/bluebird/js/release/settle.js
cortex-0.1.3 spec/dummy/node_modules/bluebird/js/release/settle.js
dragonfly_puppeteer-0.1.0 node_modules/bluebird/js/release/settle.js