From 5eaf7152bf3461c408509e858fcb60210d556561 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 19 Jan 2015 22:28:58 -0800 Subject: [PATCH] Fix some SpiderMonkey lint SpiderMonkey complains about functions not always returning a value. In most cases that is a conscious code style choice, so it is not fixed here. In one case (MockDate) the interpreter thought you could have fallen off the end of a "switch" statement, although the number of arguments prevented that. This was fixed by changing the last case to "default". In another case (QueueRunner) the function really did return a value sometimes and nothing other times, although as far as I could see, it could only ever return "undefined". The function now explicitly only returns no value. See #751 --- src/core/MockDate.js | 2 +- src/core/QueueRunner.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/MockDate.js b/src/core/MockDate.js index e7914fb2..0e5a8008 100644 --- a/src/core/MockDate.js +++ b/src/core/MockDate.js @@ -54,7 +54,7 @@ getJasmineRequireObj().MockDate = function() { case 6: return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]); - case 7: + default: return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]); } diff --git a/src/core/QueueRunner.js b/src/core/QueueRunner.js index 839fa62b..a4d24603 100644 --- a/src/core/QueueRunner.js +++ b/src/core/QueueRunner.js @@ -34,7 +34,8 @@ getJasmineRequireObj().QueueRunner = function(j$) { for(iterativeIndex = recursiveIndex; iterativeIndex < length; iterativeIndex++) { var queueableFn = queueableFns[iterativeIndex]; if (queueableFn.fn.length > 0) { - return attemptAsync(queueableFn); + attemptAsync(queueableFn); + return; } else { attemptSync(queueableFn); }