Remove unnecessary ensureSemicolon.

This commit is contained in:
Logan Smyth 2016-05-01 11:45:41 -07:00
parent 67763085ab
commit 0be2f1cf48
2 changed files with 3 additions and 11 deletions

View File

@ -101,14 +101,6 @@ export default class Buffer {
this.push(";"); this.push(";");
} }
/**
* Ensure last character is a semicolon.
*/
ensureSemicolon() {
if (!this.isLast(";")) this.semicolon();
}
/** /**
* Add a right brace to the buffer. * Add a right brace to the buffer.
*/ */

View File

@ -54,7 +54,7 @@ function ExportDeclaration(node: Object) {
if (node.declaration) { if (node.declaration) {
let declar = node.declaration; let declar = node.declaration;
this.print(declar, node); this.print(declar, node);
if (t.isStatement(declar) || t.isFunction(declar) || t.isClass(declar)) return; if (!(t.isStatement(declar) || t.isFunction(declar) || t.isClass(declar))) this.semicolon();
} else { } else {
if (node.exportKind === "type") { if (node.exportKind === "type") {
this.push("type "); this.push("type ");
@ -91,9 +91,9 @@ function ExportDeclaration(node: Object) {
this.push(" from "); this.push(" from ");
this.print(node.source, node); this.print(node.source, node);
} }
}
this.ensureSemicolon(); this.semicolon();
}
} }
export function ImportDeclaration(node: Object) { export function ImportDeclaration(node: Object) {