Remove unneeded parens for FunctionExpression inside LogicalExpression (#399)

This commit is contained in:
Brian Ng authored and Christopher Chedeau committed 2017-01-22 15:00:13 -08:00
1 parent bf32905c3f
commit badab37dd1
3 files changed
+9 -2

No files matched your search

+3
View File
@@ -399,6 +399,9 @@ FPp.needsParens = function(assumeExpressionContext) {
case "NewExpression":
return name === "callee";
case "LogicalExpression":
return node.type === "ArrowFunctionExpression";
default:
return isBinary(parent);
}
@@ -370,7 +370,8 @@ export default (function() {})();
(function() {})()\`\`;
(function() {})\`\`;
new (function() {});
(function() {})
(function() {});
a = function f() {} || b;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(function() {
}).length;
@@ -386,6 +387,8 @@ new (function() {
})();
(function() {
});
a = function f() {
} || b;
"
`;
+2 -1
View File
@@ -4,4 +4,5 @@ export default (function() {})();
(function() {})()``;
(function() {})``;
new (function() {});
(function() {})
(function() {});
a = function f() {} || b;