Merge pull request #3380 from babel/unary-arrow

Fix: Add parens for unary arrow function
This commit is contained in:
Henry Zhu 2016-02-29 12:18:12 -05:00
commit 1271d2cd52
3 changed files with 10 additions and 0 deletions

View File

@ -203,6 +203,10 @@ export function ArrowFunctionExpression(node, parent) {
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 (() => {});
!(() => {});