function createHandler(then, value, success) {
    return function(onFulfilled, onRejected) {
        var callback = success ? onFulfilled : onRejected;
        if (typeof callback !== 'function') {
            return Promise(function(resolve,reject){
                then(resolve,reject);
            });
        }
        return Promise(function(resolve,reject){
            immediate(execute,callback,value,resolve,reject);
       });
    };
}
// Creates a fulfilled or rejected .then function
Creates a fulfilled or rejected .then function
Creates a fulfilled or rejected . then function
function createHandler(then, value, success) {
    return function(onFulfilled, onRejected) {
        var callback = success ? onFulfilled : onRejected;
        if (typeof callback !== 'function') {
            return Promise(function(resolve,reject){
                then(resolve,reject);
            });
        }
        return Promise(function(resolve,reject){
            immediate(execute,callback,value,resolve,reject);
       });
    };
}
function createHandler ( then , value , success ) { return function ( onFulfilled , onRejected ) { var callback = success ? onFulfilled : onRejected ; if ( typeof callback !== 'function' ) { return Promise ( function ( resolve , reject ) { then ( resolve , reject ) ; } ) ; } return Promise ( function ( resolve , reject ) { immediate ( execute , callback , value , resolve , reject ) ; } ) ; } ; }
Creates a fulfilled or rejected .then function
Creates a fulfilled or rejected . then function