Remove unneeded parens for FunctionExpression inside LogicalExpression (#399)
This commit is contained in:
1 parent
bf32905c3f
commit
badab37dd1
3 files changed
+9
-2
No files matched your search
@@ -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;
|
||||
"
|
||||
`;
|
||||
|
||||
|
||||
@@ -4,4 +4,5 @@ export default (function() {})();
|
||||
(function() {})()``;
|
||||
(function() {})``;
|
||||
new (function() {});
|
||||
(function() {})
|
||||
(function() {});
|
||||
a = function f() {} || b;
|
||||
Reference in new issue
Block a user