Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

comments

  • Loading branch information...
commit d91045e33a6260d73f2f121184b1ffe28da016d4 1 parent f0f85f9
@brianc authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/index.js
View
9 lib/index.js
@@ -3,19 +3,23 @@ var executeAction = function(action, callback) {
var doAction = function(action, context) {
//no more repeats to execute
if(action.repeat > i++) {
+ //support for optional context overloads
+ //there might be a better way to do this
if(context) {
var cb = function() {
doAction(action, context)
}
action.run(context, cb)
- } else {
+ } else { //no context
var cb = function() {
doAction(action)
}
action.run(cb)
}
- } else {
+ } else { //no more actions to repeat, do teardown if teardown
if(action.teardown) {
+ //support for optional context overloads
+ //there might be a better way to do this
if(context) {
action.teardown(context, callback)
} else {
@@ -26,6 +30,7 @@ var executeAction = function(action, callback) {
}
}
}
+ //optional setup parameter
if(action.setup) {
action.setup(function(result) {
doAction(action, result)
Please sign in to comment.
Something went wrong with that request. Please try again.