lib/promise.js
function (callback) {
            var promise = new Promise();
            this.addCallback(function () {
                try {
                    when(isFunction(callback) ? callback.apply(this, arguments) : callback).then(promise);
                } catch (e) {
                    promise.errback(e);
                }
            });

            this.addErrback(function () {
                try {
                    when(isFunction(callback) ? callback.apply(this, arguments) : callback).then(promise);
                } catch (e) {
                    promise.errback(e);
                }
            });
            return promise.promise();
        }
function (callback) {
            var promise = new Promise();
            this.addCallback(function () {
                try {
                    when(isFunction(callback) ? callback.apply(this, arguments) : callback).then(promise);
                } catch (e) {
                    promise.errback(e);
                }
            });

            this.addErrback(function () {
                try {
                    when(isFunction(callback) ? callback.apply(this, arguments) : callback).then(promise);
                } catch (e) {
                    promise.errback(e);
                }
            });
            return promise.promise();
        }
function ( callback ) { var promise = new Promise ( ) ; this . addCallback ( function ( ) { try { when ( isFunction ( callback ) ? callback . apply ( this , arguments ) : callback ) . then ( promise ) ; } catch ( e ) { promise . errback ( e ) ; } } ) ; this . addErrback ( function ( ) { try { when ( isFunction ( callback ) ? callback . apply ( this , arguments ) : callback ) . then ( promise ) ; } catch ( e ) { promise . errback ( e ) ; } } ) ; return promise . promise ( ) ; }
Applies the same function that returns a promise to both the callback and errback.

@param {Function} callback function to call. This function must return a Promise

@return {comb.Promise} a promise to continue chaining or to resolve with.
Applies the same function that returns a promise to both the callback and errback .