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
This commit is contained in:
Philip Chimento
2015-01-19 22:28:58 -08:00
parent e5feba994f
commit 5eaf7152bf
2 changed files with 3 additions and 2 deletions

View File

@@ -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]);
}

View File

@@ -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);
}