only infer single identifier new expression callees

This commit is contained in:
Sebastian McKenzie 2015-06-01 21:52:54 +01:00
parent b1273cb774
commit 8919fc22b1

View File

@ -152,8 +152,8 @@ export function _inferTypeAnnotation(force?: boolean): ?Object {
}
}
if (path.isNodeType("NewExpression")) {
// this wont be a valid generic type annotation id unless the callee is an Identifier
if (path.isNodeType("NewExpression") && path.get("callee").isIdentifier()) {
// only resolve identifier callee
return t.genericTypeAnnotation(node.callee);
}