aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2015-05-04 14:49:17 +0300
committerMihai Bazon <mihai.bazon@gmail.com>2015-05-04 14:49:17 +0300
commitc3a10c135eac6fff360ad109f30245459b0b7e13 (patch)
tree602e0cc722ca44df8884b50517a48e8a8ccaa8fa /lib/compress.js
parent92e4340732ba9b182e339896ffda0e13ef98e40a (diff)
downloadtracifyjs-c3a10c135eac6fff360ad109f30245459b0b7e13.tar.gz
tracifyjs-c3a10c135eac6fff360ad109f30245459b0b7e13.zip
Avoid spurious brackets when dropping unused vars
Fix #702
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 7d20a4ea..944db1d2 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1168,12 +1168,12 @@ merge(Compressor.prototype, {
return make_node(AST_EmptyStatement, node);
}
if (def.length == 0) {
- return side_effects;
+ return in_list ? MAP.splice(side_effects.body) : side_effects;
}
node.definitions = def;
if (side_effects) {
side_effects.body.unshift(node);
- node = side_effects;
+ return in_list ? MAP.splice(side_effects.body) : side_effects;
}
return node;
}