Skip to content

Commit

Permalink
Remove property "errors" when only one error is catchable
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Feb 4, 2014
1 parent 2d11ee6 commit 5148ba4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lib/each.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/each.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ Each.prototype._run = () ->
if @_parallel isnt 1
if @_errors.length is 1
error = @_errors[0]
error.errors = []
# error.errors = []
else
error = new Error("Multiple errors (#{@_errors.length})")
error.errors = @_errors
else
error = @_errors[0]
error.errors = []
# error.errors = []
@emit 'error', error if @listeners('error').length or not @listeners('both').length
else
args = []
Expand Down
2 changes: 1 addition & 1 deletion test/error.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe 'Error', ->
error_assert = (err) ->
current.should.eql 6
err.message.should.eql 'Testing error in 6'
err.errors.length.should.eql 0
err.should.not.have.property 'errors'
each( [ {id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}, {id: 7}, {id: 8}, {id: 9}, {id: 10}, {id: 11} ] )
.parallel( 4 )
.on 'item', (element, index, next) ->
Expand Down

0 comments on commit 5148ba4

Please sign in to comment.