types.needsParans: add parent ExpressionStatement check for FunctionExpression

This commit is contained in:
Sebastian McKenzie
2014-11-01 15:58:44 +11:00
parent aba9bba7db
commit 646bdfd04c

View File

@@ -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;
}