diff options
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js index a2666fa9..f49486a0 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -2651,6 +2651,10 @@ merge(Compressor.prototype, { // y?true:false --> !!y if (is_true(consequent) && is_false(alternative)) { + if (self.condition.is_boolean()) { + // boolean_expression ? true : false --> boolean_expression + return self.condition; + } self.condition = self.condition.negate(compressor); return make_node(AST_UnaryPrefix, self.condition, { operator: "!", |