Skip to content

Commit

Permalink
promise: remove run from jump_to_error
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed May 10, 2015
1 parent da39418 commit 5d5f4d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
22 changes: 10 additions & 12 deletions lib/index.js

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

12 changes: 6 additions & 6 deletions src/index.coffee.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ functions share a common API with flexible options.
result = fn.apply obj, args
catch err
todos = stack.shift()
return jump_to_error err
jump_to_error err
return run()
mtodos = todos
todos = stack.shift()
todos.unshift mtodos... if mtodos.length
Expand All @@ -53,21 +54,20 @@ functions share a common API with flexible options.
stack.unshift todos
todos = []
fn.call obj, args..., (err, changed) ->
status.throw_if_error = false if err and callback
todos = stack.shift() if todos.length is 0
if err
while todos[0] and todos[0][0] isnt 'then' then todos.shift()
status.err = err
status.throw_if_error = false if err and callback
jump_to_error err if err
call_sync callback, arguments if callback
if changed and not err and not args[0]?.shy then status.changed = true
return run()
catch err
todos = stack.shift()
jump_to_error err
run()
jump_to_error = (err) ->
while todos[0] and todos[0][0] isnt 'then' then todos.shift()
status.err = err
return run()
# return run()
run = ->
todo = todos.shift()
# Nothing more to do
Expand Down

0 comments on commit 5d5f4d5

Please sign in to comment.