[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:
Sergej Jaskiewicz
2021-10-12 14:08:27 +03:00
committed by Space
parent 7243d30869
commit 1f0b691ab6
@@ -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;
}