suppress semicolons after do/while (#1556)
- unless both `beautify` & `screw-ie8` are enabled - deprecate workaround for if-do-while-else fixes #186
This commit is contained in:
@@ -784,7 +784,9 @@ function OutputStream(options) {
|
||||
output.with_parens(function(){
|
||||
self.condition.print(output);
|
||||
});
|
||||
output.semicolon();
|
||||
if (output.option("beautify") && output.option("screw_ie8")) {
|
||||
output.semicolon();
|
||||
}
|
||||
});
|
||||
DEFPRINT(AST_While, function(self, output){
|
||||
output.print("while");
|
||||
@@ -917,15 +919,6 @@ function OutputStream(options) {
|
||||
// adds the block brackets if needed.
|
||||
if (!self.body)
|
||||
return output.force_semicolon();
|
||||
if (self.body instanceof AST_Do) {
|
||||
// Unconditionally use the if/do-while workaround for all browsers.
|
||||
// https://github.com/mishoo/UglifyJS/issues/#issue/57 IE
|
||||
// croaks with "syntax error" on code like this: if (foo)
|
||||
// do ... while(cond); else ... we need block brackets
|
||||
// around do/while
|
||||
make_block(self.body, output);
|
||||
return;
|
||||
}
|
||||
var b = self.body;
|
||||
while (true) {
|
||||
if (b instanceof AST_If) {
|
||||
|
||||
Reference in New Issue
Block a user