Merge pull request babel/babel-eslint#154 from alexkuz/master

fix visiting filter in comprehension
This commit is contained in:
Henry Zhu 2015-07-25 10:08:31 -04:00
parent bb29041dce
commit 8d65e3e894
2 changed files with 12 additions and 1 deletions

View File

@ -338,7 +338,7 @@ function monkeypatch() {
} }
} }
if (node.filter) { if (node.filter) {
this.visit(block.filter); this.visit(node.filter);
} }
this.visit(node.body); this.visit(node.body);
this.close(node); this.close(node);

View File

@ -1062,6 +1062,17 @@ describe("verify", function () {
[] []
); );
}); });
it("visiting filter in comprehension", function () {
verifyAndAssertMessages([
"function test(items, val) {",
"return [ for (i of items) if (i === val) i ];",
"} test;"
].join("\n"),
{ "no-unused-vars": 1, "no-undef": 1 },
[]
);
});
}); });
describe("decorators #72", function () { describe("decorators #72", function () {