[JS] Fix some JS prettyprinting
- Print a newline after `default` case in `switch`es - Print a newline after `if` blocks without corresponding `else` blocks
This commit is contained in:
@@ -438,6 +438,7 @@ public class JsToStringGenerationVisitor extends JsVisitor {
|
||||
_colon();
|
||||
|
||||
popSourceInfo();
|
||||
newlineOpt();
|
||||
|
||||
sourceLocationConsumer.pushSourceInfo(null);
|
||||
printSwitchMemberStatements(x);
|
||||
@@ -708,7 +709,7 @@ public class JsToStringGenerationVisitor extends JsVisitor {
|
||||
}
|
||||
nestedPush(thenStmt);
|
||||
|
||||
if (thenStmt instanceof JsBlock) {
|
||||
if (thenStmt instanceof JsBlock && elseStatement != null) {
|
||||
lineBreakAfterBlock = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user