Skip to content
Permalink
Browse files

Fix: Columns of parse errors are off by 1 (fixes #4896)

  • Loading branch information...
alberto committed Jan 9, 2016
1 parent d288e62 commit 9c1bafb4c2730c64ba57cb712240eb0d44aa1f63
Showing with 4 additions and 2 deletions.
  1. +1 −1 lib/eslint.js
  2. +3 −1 tests/lib/eslint.js
@@ -567,7 +567,7 @@ module.exports = (function() {
message: "Parsing error: " + message,

line: ex.lineNumber,
column: ex.column + 1
column: ex.column
});

return null;
@@ -2196,6 +2196,8 @@ describe("eslint", function() {
assert.equal(messages[0].severity, 2);
assert.isNull(messages[0].ruleId);
assert.equal(messages[0].source, BROKEN_TEST_CODE);
assert.equal(messages[0].line, 1);
assert.equal(messages[0].column, 4);
assert.isTrue(messages[0].fatal);
assert.match(messages[0].message, /^Parsing error:/);
});
@@ -2752,7 +2754,7 @@ describe("eslint", function() {

assert.equal(messages.length, 1);
assert.equal(messages[0].line, 1);
assert.equal(messages[0].column, 21);
assert.equal(messages[0].column, 20);
assert.equal(messages[0].message, "Parsing error: Unexpected token <");
});

0 comments on commit 9c1bafb

Please sign in to comment.
You can’t perform that action at this time.