lib/vow.js
function(fn, args) {
        var len = Math.max(arguments.length - 1, 0),
            callArgs;
        if(len) { // optimization for V8
            callArgs = Array(len);
            var i = 0;
            while(i < len) {
                callArgs[i++] = arguments[i];
            }
        }

        try {
            return vow.resolve(callArgs?
                fn.apply(global, callArgs) :
                fn.call(global));
        }
        catch(e) {
            return vow.reject(e);
        }
    }
function(fn, args) {
        var len = Math.max(arguments.length - 1, 0),
            callArgs;
        if(len) { // optimization for V8
            callArgs = Array(len);
            var i = 0;
            while(i < len) {
                callArgs[i++] = arguments[i];
            }
        }

        try {
            return vow.resolve(callArgs?
                fn.apply(global, callArgs) :
                fn.call(global));
        }
        catch(e) {
            return vow.reject(e);
        }
    }
function ( fn , args ) { var len = Math . max ( arguments . length - 1 , 0 ) , callArgs ; if ( len ) { // optimization for V8 callArgs = Array ( len ) ; var i = 0 ; while ( i < len ) { callArgs [ i ++ ] = arguments [ i ] ; } } try { return vow . resolve ( callArgs ? fn . apply ( global , callArgs ) : fn . call ( global ) ) ; } catch ( e ) { return vow . reject ( e ) ; } }
Invokes the given function `fn` with arguments `args`

@param {Function} fn
@param {...*} [args]
@returns {vow:Promise}

@example
```js
var promise1 = vow.invoke(function(value) {
return value;
}, 'ok'),
promise2 = vow.invoke(function() {
throw Error();
});

promise1.isFulfilled(); // true
promise1.valueOf(); // 'ok'
promise2.isRejected(); // true
promise2.valueOf(); // instance of Error
```
Invokes the given function fn with arguments args