diff --git a/lib/compress.js b/lib/compress.js index 2a8b4c2e..a3ba16ab 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1836,6 +1836,18 @@ merge(Compressor.prototype, { return self.car; } } + if (self.cdr instanceof AST_UnaryPrefix + && self.cdr.operator == "void" + && !self.cdr.expression.has_side_effects(compressor)) { + self.cdr.operator = self.car; + return self.cdr; + } + if (self.cdr instanceof AST_Undefined) { + return make_node(AST_UnaryPrefix, self, { + operator : "void", + expression : self.car + }); + } return self; });