Skip to content

Commit

Permalink
Silence warnings when run under Mozilla's JS interpreter
Browse files Browse the repository at this point in the history
If JSLint is run under Mozilla's JS interpreter, it will spew out
some warnings like 'function blah does not always return a value'.
Explicitly add some return statements to shut Mozilla up.
  • Loading branch information
magcius committed Mar 31, 2012
1 parent 449848f commit 30d3540
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions jslint.js
Expand Up @@ -1272,6 +1272,7 @@ var JSLINT = (function () {
character += length;
return first;
}
return null;
}

function string(x) {
Expand Down Expand Up @@ -1452,7 +1453,7 @@ var JSLINT = (function () {
switch (c) {
case '':
stop_at('unclosed_regexp', line, from);
return;
return undefined;
case '/':
if (depth > 0) {
warn_at('unescaped_a', line, from + length, '/');
Expand Down Expand Up @@ -2850,6 +2851,7 @@ klass: do {
}
return token.string;
}
return null;
}


Expand All @@ -2873,7 +2875,7 @@ klass: do {
if (next_token.id === ';') {
warn('unexpected_a');
semicolon();
return;
return undefined;
}

// Is this a labeled statement?
Expand Down Expand Up @@ -4649,6 +4651,7 @@ klass: do {
advance();
return true;
}
return false;
}


Expand All @@ -4661,6 +4664,7 @@ klass: do {
advance('(number)');
return true;
}
return false;
}


Expand All @@ -4669,6 +4673,7 @@ klass: do {
advance();
return true;
}
return false;
}

function css_color() {
Expand Down Expand Up @@ -4775,6 +4780,7 @@ klass: do {
advance();
return true;
}
return false;
} else {
return css_length();
}
Expand All @@ -4787,6 +4793,7 @@ klass: do {
advance();
return true;
}
return false;
} else {
return css_length();
}
Expand Down Expand Up @@ -4817,6 +4824,7 @@ klass: do {
}
comma();
}
return false;
}


Expand Down

0 comments on commit 30d3540

Please sign in to comment.