From f1a178f8f9b2ffb5d208e1139597ba576b554f16 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 2 Jan 2015 01:59:49 +1100 Subject: [PATCH] compact body nodes in traversal --- lib/6to5/traverse/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/6to5/traverse/index.js b/lib/6to5/traverse/index.js index 204969d2a2..22cd2b00ba 100644 --- a/lib/6to5/traverse/index.js +++ b/lib/6to5/traverse/index.js @@ -107,6 +107,11 @@ function traverse(parent, opts, scope) { if (updated) { parent[key] = _.flatten(parent[key]); + + if (key === "body") { + // we can safely compact this + parent[key] = _.compact(parent[key]); + } } } else { handle(parent, key);