Replace the correct node when replacing in void sequences

Close #611.
This commit is contained in:
Richard van Velzen
2015-01-12 17:09:34 +01:00
parent a10f6a96d7
commit 42ecd42ac0
2 changed files with 22 additions and 1 deletions

View File

@@ -1937,7 +1937,7 @@ merge(Compressor.prototype, {
if (self.cdr instanceof AST_UnaryPrefix
&& self.cdr.operator == "void"
&& !self.cdr.expression.has_side_effects(compressor)) {
self.cdr.operator = self.car;
self.cdr.expression = self.car;
return self.cdr;
}
if (self.cdr instanceof AST_Undefined) {