From: Mihai Bazon Date: Tue, 19 Feb 2013 16:12:19 +0000 (+0200) Subject: Fix compressing `do {...} while (false)` X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=3a591c43fedcf07e9303773dbb0852396729a402;p=UglifyJS.git 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 --- diff --git a/lib/compress.js b/lib/compress.js index ca23c40e..3d9097e2 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;