Permalink
Browse files

[[FIX]] Don't throw '(NaN% scanned)'

  • Loading branch information...
nicolo-ribaudo committed Nov 5, 2015
1 parent 0d87919 commit 903b69800bdad5b15d0d50424ab8021081d3275f
Showing with 5 additions and 1 deletion.
  1. +1 −1 src/jshint.js
  2. +4 −0 tests/unit/parser.js
@@ -330,7 +330,7 @@ var JSHINT = (function() {

// Produce an error warning.
function quit(code, line, chr) {
var percentage = Math.floor((line / state.lines.length) * 100);
var percentage = Math.floor((line / state.lines.length) * 100) || 0;
var message = messages.errors[code].desc;

throw {
@@ -45,6 +45,10 @@ exports.other = function (test) {
.addError(1, "Unrecoverable syntax error. (100% scanned).")
.test("typeof;");

TestRun(test)
.addError(1, "Unrecoverable syntax error. (0% scanned).")
.test("}");

test.done();
};

0 comments on commit 903b698

Please sign in to comment.