Used internally to exhaust the callback sequence when a result is available.
var chain = this.chain; var fired = this.fired; var res = this.results[fired]; var self = this; var cb = null; while( (chain.length > 0) && (this.paused == 0) ){ // Array var f = chain.shift()[fired]; if(!f){ continue; } try{ res = f(res); fired = ((res instanceof Error) ? 1 : 0); if(res instanceof dojo.Deferred){ cb = function(res){ self._resback(res); // inlined from _pause() self.paused--; if( (self.paused == 0) && (self.fired >= 0) ){ self._fire(); } } // inlined from _unpause this.paused++; } }catch(err){ console.debug(err); fired = 1; res = err; } } this.fired = fired; this.results[fired] = res; if((cb)&&(this.paused)){ // this is for "tail recursion" in case the dependent // deferred is already fired res.addBoth(cb); }