benchmark/co/index.js
function next( ret ) {
            if( ret.done ) {
                return resolve( ret.value );
            }
            var value = toPromise.call( ctx, ret.value );
            if( value && isPromise( value ) ) {
                return value.then( onFulfilled, onRejected );
            }
            return onRejected( new TypeError( 'You may only yield a function, promise, generator, array, or object, '
                                              + 'but the following object was passed: "' + String( ret.value )
                                              + '"' ) );
        }
function next( ret ) {
            if( ret.done ) {
                return resolve( ret.value );
            }
            var value = toPromise.call( ctx, ret.value );
            if( value && isPromise( value ) ) {
                return value.then( onFulfilled, onRejected );
            }
            return onRejected( new TypeError( 'You may only yield a function, promise, generator, array, or object, '
                                              + 'but the following object was passed: "' + String( ret.value )
                                              + '"' ) );
        }
function next ( ret ) { if ( ret . done ) { return resolve ( ret . value ) ; } var value = toPromise . call ( ctx , ret . value ) ; if ( value && isPromise ( value ) ) { return value . then ( onFulfilled , onRejected ) ; } return onRejected ( new TypeError ( 'You may only yield a function, promise, generator, array, or object, ' + 'but the following object was passed: "' + String ( ret . value ) + '"' ) ) ; }
Get the next value in the generator,
return a promise.

@param {Object} ret
@return {Promise}
@api private
Get the next value in the generator return a promise .