src/ScraperPromise.js
function(error) {
		var that = this,
			param = this.chainParameter,
			stopPointer = {},
			utils = {
				stop: null,
				url: this.scraper.url,
				scraper: this,
				params: param,
				lastReturn: undefined
			},
			keep = true;
		this.chainParameter = null;

		if (error) {
			this.errorCallback(error, utils);
			this.doneCallback(utils);
			return;
		}

		async.eachSeries(this.promises, function dispatcher(fn, callback) {
			var done = function(err, lastReturn) {
				utils.lastReturn = lastReturn;
				if (err === stopPointer) {
					keep = false;
					callback(err);
				} else if (err) {
					callback(err);
				} else if (keep) {
					callback();
				}
			};
			utils.stop = function() {
				done(stopPointer, null);
			};

			try {
				fn.call(that, done, utils);
			} catch (err) {
				done(err, null);
			}
		}, function(err) {
			utils.stop = null;
			if (err && err !== stopPointer) {
				that.errorCallback(err, utils);
			}
			that.doneCallback(utils.lastReturn, utils);
			that.scraper.close();
		});
	}
function(error) {
		var that = this,
			param = this.chainParameter,
			stopPointer = {},
			utils = {
				stop: null,
				url: this.scraper.url,
				scraper: this,
				params: param,
				lastReturn: undefined
			},
			keep = true;
		this.chainParameter = null;

		if (error) {
			this.errorCallback(error, utils);
			this.doneCallback(utils);
			return;
		}

		async.eachSeries(this.promises, function dispatcher(fn, callback) {
			var done = function(err, lastReturn) {
				utils.lastReturn = lastReturn;
				if (err === stopPointer) {
					keep = false;
					callback(err);
				} else if (err) {
					callback(err);
				} else if (keep) {
					callback();
				}
			};
			utils.stop = function() {
				done(stopPointer, null);
			};

			try {
				fn.call(that, done, utils);
			} catch (err) {
				done(err, null);
			}
		}, function(err) {
			utils.stop = null;
			if (err && err !== stopPointer) {
				that.errorCallback(err, utils);
			}
			that.doneCallback(utils.lastReturn, utils);
			that.scraper.close();
		});
	}
function ( error ) { var that = this , param = this . chainParameter , stopPointer = { } , utils = { stop : null , url : this . scraper . url , scraper : this , params : param , lastReturn : undefined } , keep = true ; this . chainParameter = null ; if ( error ) { this . errorCallback ( error , utils ) ; this . doneCallback ( utils ) ; return ; } async . eachSeries ( this . promises , function dispatcher ( fn , callback ) { var done = function ( err , lastReturn ) { utils . lastReturn = lastReturn ; if ( err === stopPointer ) { keep = false ; callback ( err ) ; } else if ( err ) { callback ( err ) ; } else if ( keep ) { callback ( ) ; } } ; utils . stop = function ( ) { done ( stopPointer , null ) ; } ; try { fn . call ( that , done , utils ) ; } catch ( err ) { done ( err , null ) ; } } , function ( err ) { utils . stop = null ; if ( err && err !== stopPointer ) { that . errorCallback ( err , utils ) ; } that . doneCallback ( utils . lastReturn , utils ) ; that . scraper . close ( ) ; } ) ; }
Starts the promise chain.

@param  {?} error Error object, to fire the error callback,
from an error that happened before.
@param  {!Scraper} scraper Scraper to use in the promise chain.
@protected
Starts the promise chain .