Code coverage report for debug\synchronous_inspection.js

Statements: 100% (54 / 54)      Branches: 100% (10 / 10)      Functions: 100% (16 / 16)      Lines: 100% (54 / 54)      Ignored: none     

All files » debug\ » synchronous_inspection.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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106  8 8 8 326 24 24 24     302 302       8 63 3   60     8   56 3   53     8   73401     8   37069     8   12846     8   26126     8 471     8 224     8 437     8 324     8 1762   1762   1762     8 1126   1126   1126 1126     8 220 220 3   217     8 54 54 3   51 51       8        
(function () { "use strict";
module.exports = function(Promise) {
var ASSERT = require("./assert.js");
function PromiseInspection(promise) {
    if (promise !== undefined) {
        promise = promise._target();
        this._bitField = promise._bitField;
        this._settledValue = promise._settledValue;
    }
    else {
        this._bitField = 0;
        this._settledValue = undefined;
    }
}
 
PromiseInspection.prototype.value = function () {
    if (!this.isFulfilled()) {
        throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a    See http://goo.gl/hc1DLj\u000a");
    }
    return this._settledValue;
};
 
PromiseInspection.prototype.error =
PromiseInspection.prototype.reason = function () {
    if (!this.isRejected()) {
        throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a    See http://goo.gl/hPuiwB\u000a");
    }
    return this._settledValue;
};
 
PromiseInspection.prototype.isFulfilled =
Promise.prototype._isFulfilled = function () {
    return (this._bitField & 268435456) > 0;
};
 
PromiseInspection.prototype.isRejected =
Promise.prototype._isRejected = function () {
    return (this._bitField & 134217728) > 0;
};
 
PromiseInspection.prototype.isPending =
Promise.prototype._isPending = function () {
    return (this._bitField & 402653184) === 0;
};
 
PromiseInspection.prototype.isResolved =
Promise.prototype._isResolved = function () {
    return (this._bitField & 402653184) > 0;
};
 
Promise.prototype.isPending = function() {
    return this._target()._isPending();
};
 
Promise.prototype.isRejected = function() {
    return this._target()._isRejected();
};
 
Promise.prototype.isFulfilled = function() {
    return this._target()._isFulfilled();
};
 
Promise.prototype.isResolved = function() {
    return this._target()._isResolved();
};
 
Promise.prototype._value = function() {
    ASSERT((! this._isFollowing()),
    "!this._isFollowing()");
    ASSERT(this._isFulfilled(),
    "this._isFulfilled()");
    return this._settledValue;
};
 
Promise.prototype._reason = function() {
    ASSERT((! this._isFollowing()),
    "!this._isFollowing()");
    ASSERT(this._isRejected(),
    "this._isRejected()");
    this._unsetRejectionIsUnhandled();
    return this._settledValue;
};
 
Promise.prototype.value = function() {
    var target = this._target();
    if (!target.isFulfilled()) {
        throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a    See http://goo.gl/hc1DLj\u000a");
    }
    return target._settledValue;
};
 
Promise.prototype.reason = function() {
    var target = this._target();
    if (!target.isRejected()) {
        throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a    See http://goo.gl/hPuiwB\u000a");
    }
    target._unsetRejectionIsUnhandled();
    return target._settledValue;
};
 
 
Promise.PromiseInspection = PromiseInspection;
};
 
}());