Merge pull request babel/babel-eslint#152 from bgw/line-x
Replace 'Line X' with actual line number
This commit is contained in:
parent
d4318aa0d8
commit
c5bbf91892
@ -430,7 +430,7 @@ exports.parse = function (code) {
|
|||||||
err.column = err.loc.column;
|
err.column = err.loc.column;
|
||||||
|
|
||||||
// remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start
|
// remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start
|
||||||
err.message = "Line X: " + err.message.replace(/ \((\d+):(\d+)\)$/, "");
|
err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
throw err;
|
throw err;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ describe("verify", function () {
|
|||||||
verifyAndAssertMessages(
|
verifyAndAssertMessages(
|
||||||
"{ , res }",
|
"{ , res }",
|
||||||
{},
|
{},
|
||||||
[ "1:2 Line X: Unexpected token" ]
|
[ "1:2 Unexpected token" ]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user