index.js
function () {
    if (head.open === 0 && head.next) { // advance the head, if possible
      head = head.next;
    }
    head.open = head.open || 0;
    head.callbacks = head.callbacks || [false];

    var dispatchInternal = function (fnIndex) {
      head.open += 1;
      setImmediate(function () {
        var opts = makeOpts(head.opts[fnIndex]);
        if (errorCount > 0) {
          return;
        }
        var handleError = function (err) {
          errorCount += 1;
          opts.onError(err, errorCount);
        };
        var callback = function (err) {
          setImmediate(function () {
            if (head.callbacks[fnIndex]) {
              handleError(new Error('function called back twice!'));
            }
            head.callbacks[fnIndex] = true;
            if (err) {
              handleError(err);
            }
            head.open -= 1;
            setImmediate(dispatch);
          });
        };
        if (opts.wrapWithTry) {
          try {
            head.fns[fnIndex](callback);
          } catch (err) {
            head.open -= 1;
            handleError(err);
          }
        } else {
          head.fns[fnIndex](callback);
        }
      });
    };

    for (head.fnIndex = head.fnIndex || 0; head.fnIndex < head.fns.length; head.fnIndex += 1) {
      dispatchInternal(head.fnIndex);
    }
  }
function () {
    if (head.open === 0 && head.next) { // advance the head, if possible
      head = head.next;
    }
    head.open = head.open || 0;
    head.callbacks = head.callbacks || [false];

    var dispatchInternal = function (fnIndex) {
      head.open += 1;
      setImmediate(function () {
        var opts = makeOpts(head.opts[fnIndex]);
        if (errorCount > 0) {
          return;
        }
        var handleError = function (err) {
          errorCount += 1;
          opts.onError(err, errorCount);
        };
        var callback = function (err) {
          setImmediate(function () {
            if (head.callbacks[fnIndex]) {
              handleError(new Error('function called back twice!'));
            }
            head.callbacks[fnIndex] = true;
            if (err) {
              handleError(err);
            }
            head.open -= 1;
            setImmediate(dispatch);
          });
        };
        if (opts.wrapWithTry) {
          try {
            head.fns[fnIndex](callback);
          } catch (err) {
            head.open -= 1;
            handleError(err);
          }
        } else {
          head.fns[fnIndex](callback);
        }
      });
    };

    for (head.fnIndex = head.fnIndex || 0; head.fnIndex < head.fns.length; head.fnIndex += 1) {
      dispatchInternal(head.fnIndex);
    }
  }
function ( ) { if ( head . open === 0 && head . next ) { // advance the head, if possible head = head . next ; } head . open = head . open || 0 ; head . callbacks = head . callbacks || [ false ] ; var dispatchInternal = function ( fnIndex ) { head . open += 1 ; setImmediate ( function ( ) { var opts = makeOpts ( head . opts [ fnIndex ] ) ; if ( errorCount > 0 ) { return ; } var handleError = function ( err ) { errorCount += 1 ; opts . onError ( err , errorCount ) ; } ; var callback = function ( err ) { setImmediate ( function ( ) { if ( head . callbacks [ fnIndex ] ) { handleError ( new Error ( 'function called back twice!' ) ) ; } head . callbacks [ fnIndex ] = true ; if ( err ) { handleError ( err ) ; } head . open -= 1 ; setImmediate ( dispatch ) ; } ) ; } ; if ( opts . wrapWithTry ) { try { head . fns [ fnIndex ] ( callback ) ; } catch ( err ) { head . open -= 1 ; handleError ( err ) ; } } else { head . fns [ fnIndex ] ( callback ) ; } } ) ; } ; for ( head . fnIndex = head . fnIndex || 0 ; head . fnIndex < head . fns . length ; head . fnIndex += 1 ) { dispatchInternal ( head . fnIndex ) ; } }
call the next target function(s), if possible, when appropriate
call the next target function ( s ) if possible when appropriate