Merge pull request babel/babel-eslint#154 from alexkuz/master
fix visiting filter in comprehension
This commit is contained in:
parent
bb29041dce
commit
8d65e3e894
@ -338,7 +338,7 @@ function monkeypatch() {
|
||||
}
|
||||
}
|
||||
if (node.filter) {
|
||||
this.visit(block.filter);
|
||||
this.visit(node.filter);
|
||||
}
|
||||
this.visit(node.body);
|
||||
this.close(node);
|
||||
|
||||
@ -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 () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user