Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Upgrade: espree 3.1.4 (fixes eslint#5923, fixes eslint#5756)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo authored and nzakas committed Apr 22, 2016
1 parent 495c6c4 commit 25d626a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"doctrine": "^1.2.1",
"es6-map": "^0.1.3",
"escope": "^3.6.0",
"espree": "3.1.3",
"espree": "3.1.4",
"estraverse": "^4.2.0",
"esutils": "^2.0.2",
"file-entry-cache": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/util/comment-event-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ describe("NodeEventGenerator", function() {
["Identifier:exit", ast.body[0].declarations[0].id],
["Literal", ast.body[0].declarations[0].init],
["Literal:exit", ast.body[0].declarations[0].init],
["LineComment:exit", ast.comments[0]], // foo
["VariableDeclarator:exit", ast.body[0].declarations[0]],
["LineComment:exit", ast.comments[2]], // bar
["VariableDeclaration:exit", ast.body[0]],
["LineComment:exit", ast.comments[0]], // foo
["Program:exit", ast]
];

Expand Down
16 changes: 16 additions & 0 deletions tests/lib/util/source-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,22 @@ describe("SourceCode", function() {
eslint.verify(code, config, "", true);
});

it("should not attach duplicate leading comments from previous node", function() {
var code = [
"//foo",
"var zzz /*aaa*/ = 777;",
"//bar"
].join("\n");

eslint.reset();
eslint.on("Program", assertCommentCount(0, 0));
eslint.on("VariableDeclaration", assertCommentCount(1, 1));
eslint.on("VariableDeclarator", assertCommentCount(0, 0));
eslint.on("Identifier", assertCommentCount(0, 1));
eslint.on("Literal", assertCommentCount(1, 0));

eslint.verify(code, config, "", true);
});
});

describe("getLines()", function() {
Expand Down

0 comments on commit 25d626a

Please sign in to comment.