Skip to content

Commit

Permalink
Added guard for func being undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
fiznool committed Aug 5, 2014
1 parent 8d587e3 commit 517891d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/jasmine-node/jasmine/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
return spec.doneFunc();
}
};
if (func.length > 0) {
if (func != null ? func.length : void 0) {
wrappedFunc = function(done) {
spec.doneFunc = done;
func.call(this, wrappedDone);
Expand Down
2 changes: 1 addition & 1 deletion src/jasmine/boot.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ boot = (jasmineRequire, clockCallback) ->
return spec.doneFunc()
return

if func.length > 0
if func?.length
wrappedFunc = (done) ->
spec.doneFunc = done
func.call(@, wrappedDone)
Expand Down

0 comments on commit 517891d

Please sign in to comment.