Fix: Add parens for unary arrow function

Fixes T7157
This commit is contained in:
Henry Zhu 2016-02-28 21:27:27 -05:00
parent 6aff776124
commit ec3c183668
3 changed files with 10 additions and 0 deletions

View File

@ -204,6 +204,10 @@ export function ArrowFunctionExpression(node: Object, parent: Object): boolean {
return true;
}
if (t.isUnaryExpression(parent)) {
return true;
}
return UnaryLike(node, parent);
}

View File

@ -0,0 +1,3 @@
void (() => {});
typeof (() => {});
!(() => {});

View File

@ -0,0 +1,3 @@
void (() => {});
typeof (() => {});
!(() => {});