Skip to content

Commit

Permalink
Update: Pass filePath to parser (fixes eslint#5344)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmote committed Apr 1, 2016
1 parent 96644d4 commit 51ff690
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/eslint.js
Expand Up @@ -564,10 +564,11 @@ module.exports = (function() {
* as possible
* @param {string} text The text to parse.
* @param {Object} config The ESLint configuration object.
* @param {string} filePath The absolute path to the file getting parsed.
* @returns {ASTNode} The AST if successful or null if not.
* @private
*/
function parse(text, config) {
function parse(text, config, filePath) {

var parser,
parserOptions = {
Expand All @@ -576,7 +577,8 @@ module.exports = (function() {
raw: true,
tokens: true,
comment: true,
attachComment: true
attachComment: true,
filePath: filePath
};

try {
Expand Down Expand Up @@ -752,7 +754,8 @@ module.exports = (function() {
shebang = captured;
return "//" + captured;
}),
config
config,
currentFilename
);

if (ast) {
Expand Down

0 comments on commit 51ff690

Please sign in to comment.