Code coverage report for debug\settle.js

Statements: 100% (32 / 32)      Branches: 100% (2 / 2)      Functions: 100% (7 / 7)      Lines: 100% (32 / 32)      Ignored: none     

All files » debug\ » settle.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55  8   8 8 8   8 130 130   8   8 241   241 241 241 106       8 194   194   194 194 194 194   8 47   47   47 47 47 47     8 118     8 12          
(function () { "use strict";
module.exports =
    function(Promise, PromiseArray) {
var ASSERT = require("./assert.js");
var PromiseInspection = Promise.PromiseInspection;
var util = require("./util.js");
 
function SettledPromiseArray(values) {
    this.constructor$(values);
    this._promise._setIsSpreadable();
}
util.inherits(SettledPromiseArray, PromiseArray);
 
SettledPromiseArray.prototype._promiseResolved = function (index, inspection) {
    ASSERT(((typeof index) === "number"),
    "typeof index === \u0022number\u0022");
    this._values[index] = inspection;
    var totalResolved = ++this._totalResolved;
    if (totalResolved >= this._length) {
        this._resolve(this._values);
    }
};
 
SettledPromiseArray.prototype._promiseFulfilled = function (value, index) {
    ASSERT((! this._isResolved()),
    "!this._isResolved()");
    ASSERT(((typeof index) === "number"),
    "typeof index === \u0022number\u0022");
    var ret = new PromiseInspection();
    ret._bitField = 268435456;
    ret._settledValue = value;
    this._promiseResolved(index, ret);
};
SettledPromiseArray.prototype._promiseRejected = function (reason, index) {
    ASSERT((! this._isResolved()),
    "!this._isResolved()");
    ASSERT(((typeof index) === "number"),
    "typeof index === \u0022number\u0022");
    var ret = new PromiseInspection();
    ret._bitField = 134217728;
    ret._settledValue = reason;
    this._promiseResolved(index, ret);
};
 
Promise.settle = function (promises) {
    return new SettledPromiseArray(promises).promise();
};
 
Promise.prototype.settle = function () {
    return new SettledPromiseArray(this).promise();
};
};
 
}());