add support for type cast expressions - fixes babel/babel-eslint#102

This commit is contained in:
Sebastian McKenzie 2015-05-16 23:17:03 +01:00
parent 5ba504f809
commit b699e4f2aa
2 changed files with 12 additions and 0 deletions

View File

@ -171,6 +171,10 @@ var astTransformVisitor = {
delete node.argument; delete node.argument;
} }
if (t.isTypeCastExpression(node)) {
return node.expression;
}
if (t.isFlow(node)) { if (t.isFlow(node)) {
return this.remove(); return this.remove();
} }

View File

@ -124,6 +124,14 @@ describe("verify", function () {
); );
}); });
it("type cast expression", function () {
verifyAndAssertMessages(
"for (let a of (a: Array)) {}",
{},
[]
);
});
it("class usage", function () { it("class usage", function () {
verifyAndAssertMessages( verifyAndAssertMessages(
"class Lol {} module.exports = Lol;", "class Lol {} module.exports = Lol;",