var pull = require('pull-core')

function all(ary, abort, cb) {
  var n = ary.length
  ary.forEach(function (f) {
    if(f) f(abort, next)
    else next()
  })

  function next() {
    if(--n) return
    cb(abort)
  }
  if(!n) next()
}

module.exports = pull.Source(function (streams) {
  return function (abort, cb) {
    ;(function next () {
      if(abort)
        all(streams, abort, cb)
      else if(!streams.length)
          cb(true)
      else if(!streams[0])
        streams.shift(), next()
      else
        streams[0](null, function (err, data) {
          if(err) {
              streams.shift()
            if(err !== true)
              abort = err
            next()
          }
          else
            cb(null, data)
        })
      })()
  }
})

@@ -627,24 +627,26 @@
 rr !== true)
+ %7B
 %0A           
@@ -660,16 +660,175 @@
 t = err%0A
+              //abort all streams%0A              while(streams.length)%0A                streams.shift()(err, function () %7B%7D)%0A              cb(err)%0A            %7D%0A
         

abort all streams if one errors