added a supplementary type check to Casper#createStep()
Showing
1 changed file
with
3 additions
and
0 deletions
... | @@ -235,6 +235,9 @@ | ... | @@ -235,6 +235,9 @@ |
235 | * @return Function The final step function | 235 | * @return Function The final step function |
236 | */ | 236 | */ |
237 | createStep: function(fn, options) { | 237 | createStep: function(fn, options) { |
238 | if (!isType(fn, "function")) { | ||
239 | throw "createStep(): a step definition must be a function"; | ||
240 | } | ||
238 | fn.options = isType(options, "object") ? options : {}; | 241 | fn.options = isType(options, "object") ? options : {}; |
239 | return fn; | 242 | return fn; |
240 | }, | 243 | }, | ... | ... |
-
Please register or sign in to post a comment