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
This commit is contained in:
Mihai Bazon
2013-02-19 18:12:19 +02:00
parent db66eca958
commit 3a591c43fe

View File

@@ -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;