Permalink
Browse files

Added throw new Error, for fatal JS lint errors. Allows us to failone…

…rror if required, as part of build
  • Loading branch information...
1 parent a040301 commit 7878c0101a03b65a5f8788cfff65e34155fb0e14 @sdesai sdesai committed Oct 23, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 componentbuild/lib/jslint/jslint-console.js
@@ -31,13 +31,19 @@ load(jslintsrc);
print("- OK");
} else {
print(" \n");
+
for (var i=0; i < JSLINT.errors.length; ++i) {
var e = JSLINT.errors[i];
if (e) {
print("\t" + e.line + ", " + e.character + ": " + e.reason + "\n\t" + clean(e.evidence) + "\n");
}
}
- print(" \n");
+ print(" \n");
+
+ // Last item is null if JSLint hit a fatal error
+ if (JSLINT.errors && JSLINT.errors[JSLINT.errors.length-1] === null) {
+ throw new Error("Fatal JSLint Exception. Stopped lint");
+ }
}
}

0 comments on commit 7878c01

Please sign in to comment.