From 517891dabe61080457c332a6e1553131b71cc400 Mon Sep 17 00:00:00 2001 From: Tom Spencer Date: Tue, 5 Aug 2014 19:54:44 +0100 Subject: [PATCH] Added guard for func being undefined --- lib/jasmine-node/jasmine/boot.js | 2 +- src/jasmine/boot.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jasmine-node/jasmine/boot.js b/lib/jasmine-node/jasmine/boot.js index d312e6a..a61f73d 100755 --- a/lib/jasmine-node/jasmine/boot.js +++ b/lib/jasmine-node/jasmine/boot.js @@ -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); diff --git a/src/jasmine/boot.coffee b/src/jasmine/boot.coffee index 5ab5355..3eff776 100644 --- a/src/jasmine/boot.coffee +++ b/src/jasmine/boot.coffee @@ -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)