Code coverage report for debug\direct_resolve.js

Statements: 96% (24 / 25)      Branches: 91.67% (11 / 12)      Functions: 100% (8 / 8)      Lines: 96% (24 / 25)      Ignored: none     

All files » debug\ » direct_resolve.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  8 8 8 8   8 8 182   8 126     8 46 18 15   28 28 25               8   217 28               189     8   150 18               132          
(function () { "use strict";
var util = require("./util.js");
var ASSERT = require("./assert.js");
var isPrimitive = util.isPrimitive;
var wrapsPrimitiveReceiver = util.wrapsPrimitiveReceiver;
 
module.exports = function(Promise) {
var returner = function () {
    return this;
};
var thrower = function () {
    throw this;
};
 
var wrapper = function (value, action) {
    if (action === 1) {
        return function () {
            throw value;
        };
    } else Eif (action === 2) {
        return function () {
            return value;
        };
    }
    ASSERT(false,
    "false");
};
 
 
Promise.prototype["return"] =
Promise.prototype.thenReturn = function (value) {
    if (wrapsPrimitiveReceiver && isPrimitive(value)) {
        return this._then(
            wrapper(value, 2),
            undefined,
            undefined,
            undefined,
            undefined
       );
    }
    return this._then(returner, undefined, undefined, value, undefined);
};
 
Promise.prototype["throw"] =
Promise.prototype.thenThrow = function (reason) {
    if (wrapsPrimitiveReceiver && isPrimitive(reason)) {
        return this._then(
            wrapper(reason, 1),
            undefined,
            undefined,
            undefined,
            undefined
       );
    }
    return this._then(thrower, undefined, undefined, reason, undefined);
};
};
 
}());