Add a check for parentheses for AwaitExpressions (fixes T6913)

This commit is contained in:
Henry Zhu
2016-01-04 08:29:12 -05:00
parent 2516b7570f
commit ab2135bc9f
3 changed files with 32 additions and 0 deletions

View File

@@ -144,6 +144,16 @@ export function SequenceExpression(node: Object, parent: Object): boolean {
return true;
}
export function AwaitExpression(node: Object, parent: Object): boolean {
return t.isBinary(parent) ||
t.isUnaryLike(parent) ||
t.isCallExpression(parent) ||
t.isMemberExpression(parent) ||
t.isNewExpression(parent) ||
t.isConditionalExpression(parent) ||
t.isAwaitExpression(parent);
}
export function YieldExpression(node: Object, parent: Object): boolean {
return t.isBinary(parent) ||
t.isUnaryLike(parent) ||