Fix generator missing parens on Flow union types (#6334)

This commit is contained in:
Brian Ng
2017-09-29 13:43:38 -05:00
committed by Henry Zhu
parent f0ab0f81d3
commit 832408e85d
4 changed files with 34 additions and 3 deletions

View File

@@ -93,6 +93,17 @@ export function Binary(node: Object, parent: Object): boolean {
return false;
}
export function UnionTypeAnnotation(node: Object, parent: Object): boolean {
return (
t.isArrayTypeAnnotation(parent) ||
t.isNullableTypeAnnotation(parent) ||
t.isIntersectionTypeAnnotation(parent) ||
t.isUnionTypeAnnotation(parent)
);
}
export { UnionTypeAnnotation as IntersectionTypeAnnotation };
export function TSAsExpression() {
return true;
}