From 646bdfd04c2e2c8508e8953fa410401ef438f32b Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 1 Nov 2014 15:58:44 +1100 Subject: [PATCH] types.needsParans: add parent ExpressionStatement check for FunctionExpression --- lib/6to5/types.js | 4 ++++ 1 file changed, 4 insertions(+) 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; }