[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();
|
_colon();
|
||||||
|
|
||||||
popSourceInfo();
|
popSourceInfo();
|
||||||
|
newlineOpt();
|
||||||
|
|
||||||
sourceLocationConsumer.pushSourceInfo(null);
|
sourceLocationConsumer.pushSourceInfo(null);
|
||||||
printSwitchMemberStatements(x);
|
printSwitchMemberStatements(x);
|
||||||
@@ -708,7 +709,7 @@ public class JsToStringGenerationVisitor extends JsVisitor {
|
|||||||
}
|
}
|
||||||
nestedPush(thenStmt);
|
nestedPush(thenStmt);
|
||||||
|
|
||||||
if (thenStmt instanceof JsBlock) {
|
if (thenStmt instanceof JsBlock && elseStatement != null) {
|
||||||
lineBreakAfterBlock = false;
|
lineBreakAfterBlock = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user