lib/promise.js
function (promise, i) {
            var self = this;
            promise.then(
                function () {
                    var args = argsToArray(arguments);
                    args.unshift(i);
                    spreadArgs(self.callback, args, self);
                    promise = i = self = null;
                },
                function () {
                    var args = argsToArray(arguments);
                    args.unshift(i);
                    spreadArgs(self.errback, args, self);
                    promise = i = self = null;
                });
        }
function (promise, i) {
            var self = this;
            promise.then(
                function () {
                    var args = argsToArray(arguments);
                    args.unshift(i);
                    spreadArgs(self.callback, args, self);
                    promise = i = self = null;
                },
                function () {
                    var args = argsToArray(arguments);
                    args.unshift(i);
                    spreadArgs(self.errback, args, self);
                    promise = i = self = null;
                });
        }
function ( promise , i ) { var self = this ; promise . then ( function ( ) { var args = argsToArray ( arguments ) ; args . unshift ( i ) ; spreadArgs ( self . callback , args , self ) ; promise = i = self = null ; } , function ( ) { var args = argsToArray ( arguments ) ; args . unshift ( i ) ; spreadArgs ( self . errback , args , self ) ; promise = i = self = null ; } ) ; }
Add a promise to our chain
@private
@param promise the promise to add to our chain
@param i the index of the promise in our chain
Add a promise to our chain