Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2690 from kjgorman/kjgorman/jslint-non-null-counting
Browse files Browse the repository at this point in the history
Resolves #2688 - Incorrect JSLINT status bar count
  • Loading branch information
redmunds committed Jan 29, 2013
2 parents 84a7324 + 692383f commit e986984
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/language/JSLintUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,16 @@ define(function (require, exports, module) {
if (JSLINT.errors.length === 1) {
StatusBar.updateIndicator(module.id, true, "jslint-errors", Strings.JSLINT_ERROR_INFORMATION);
} else {
StatusBar.updateIndicator(module.id, true, "jslint-errors", StringUtils.format(Strings.JSLINT_ERRORS_INFORMATION, JSLINT.errors.length));
//return the number of non-null errors
var numberOfErrors = JSLINT.errors.filter(function (err) { return err !== null; }).length;
//if there was a null value it means there was a stop notice and an indertiminate
//upper bound on the number of JSLint errors, which we'll represent by appending a '+'
if (numberOfErrors !== JSLINT.errors.length) {
//first discard the stop notice
numberOfErrors -= 1;
numberOfErrors += "+";
}
StatusBar.updateIndicator(module.id, true, "jslint-errors", StringUtils.format(Strings.JSLINT_ERRORS_INFORMATION, numberOfErrors));
}
_setGotoEnabled(true);
} else {
Expand Down

0 comments on commit e986984

Please sign in to comment.