From 70fd2b1f336535188696d9e7b198b8acd31aa558 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Wed, 24 Oct 2012 09:33:32 +0300 Subject: fix for `if (...) return; else return ...;` (it was assumed that the first `return` always contains a value) close #22 --- lib/compress.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/compress.js') diff --git a/lib/compress.js b/lib/compress.js index 22fb330e..2ea91d0c 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1220,8 +1220,8 @@ merge(Compressor.prototype, { return make_node(self.body.CTOR, self, { value: make_node(AST_Conditional, self, { condition : self.condition, - consequent : self.body.value, - alternative : self.alternative.value || make_node(AST_Undefined, self).optimize(compressor) + consequent : self.body.value || make_node(AST_Undefined, self.body).optimize(compressor), + alternative : self.alternative.value || make_node(AST_Undefined, self.alternative).optimize(compressor) }) }).transform(compressor); } -- cgit v1.2.3