Skip to content

Commit

Permalink
do_warn now respects JSLint.suppressed_messages setting and retur…
Browse files Browse the repository at this point in the history
…ns false instead of warning object when appropriate; `stop` only stops if the return value of `do_warn` is not false
  • Loading branch information
penartur committed May 25, 2012
1 parent 3903a0d commit 7e47250
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,9 @@ var JSLINT = (function () {

function do_warn(message, offender, a, b, c, d) {
var character, line, warning;
if (JSLINT.suppressed_messages[message] === true) {
return false;
}
offender = offender || next_token; // ~~
line = offender.line || 0;
character = offender.from || 0;
Expand Down Expand Up @@ -1157,7 +1160,9 @@ var JSLINT = (function () {

function stop(message, offender, a, b, c, d) {
var warning = do_warn(message, offender, a, b, c, d);
quit(bundle.stopping, warning.line, warning.character);
if (warning !== false) {
quit(bundle.stopping, warning.line, warning.character);
}
}

function stop_at(message, line, character, a, b, c, d) {
Expand Down

0 comments on commit 7e47250

Please sign in to comment.