Include newline insertion in the call sites of rightBrace.

This commit is contained in:
Logan Smyth 2016-07-16 13:41:54 -07:00
parent 0e05e9f216
commit 6bf52b74c0
3 changed files with 5 additions and 2 deletions

View File

@ -24,6 +24,9 @@ export function BlockStatement(node: Object) {
this.removeTrailingNewline();
this.source("end", node.loc);
if (!this.endsWith("\n")) this.newline();
this.rightBrace();
} else {
this.source("end", node.loc);

View File

@ -42,6 +42,8 @@ export function ClassBody(node: Object) {
this.printSequence(node.body, node);
this.dedent();
if (!this.endsWith("\n")) this.newline();
this.rightBrace();
}
}

View File

@ -76,8 +76,6 @@ export default class Printer {
*/
rightBrace(): void {
if (!this.endsWith("\n")) this.newline();
if (this.format.minified) {
this._buf.removeLastSemicolon();
}