diff --git a/lib/6to5/types.js b/lib/6to5/types.js index f6eee9a4da..f303e3cb02 100644 --- a/lib/6to5/types.js +++ b/lib/6to5/types.js @@ -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; }