types.needsParans: add parent ExpressionStatement check for FunctionExpression
This commit is contained in:
@@ -166,6 +166,10 @@ exports.needsParans = function (node, parent) {
|
||||
}
|
||||
|
||||
if (node.type === "FunctionExpression") {
|
||||
if (parent.type === "ExpressionStatement") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (parent.type === "MemberExpression" && parent.object === node) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user