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 Dec 4, 2014
1 parent f88a5d4 commit da0601d
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 da0601d

Please sign in to comment.