From 3a591c43fedcf07e9303773dbb0852396729a402 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Tue, 19 Feb 2013 18:12:19 +0200 Subject: [PATCH] Fix compressing `do {...} while (false)` It's not safe to transform it to {...} because the body might contain `break`. The solution could be more elaborate (detect if body contains `break`) but I don't think it's worth the trouble. Close #129 --- lib/compress.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/compress.js b/lib/compress.js index ca23c40ee3f..3d9097e23a2 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1197,8 +1197,6 @@ merge(Compressor.prototype, { extract_declarations_from_unreachable_code(compressor, self.body, a); return make_node(AST_BlockStatement, self, { body: a }); } - } else { - return self.body; } } return self;