Use the common space helper everywhere to ensure we get the smallest output possible.

This commit is contained in:
Logan Smyth
2016-04-30 14:57:17 -07:00
parent 5c74ebb87e
commit df2c3f3d25
12 changed files with 83 additions and 83 deletions

View File

@@ -3,24 +3,24 @@ export function ClassDeclaration(node: Object) {
this.word("class");
if (node.id) {
this.push(" ");
this.space();
this.print(node.id, node);
}
this.print(node.typeParameters, node);
if (node.superClass) {
this.push(" ");
this.space();
this.word("extends");
this.push(" ");
this.space();
this.print(node.superClass, node);
this.print(node.superTypeParameters, node);
}
if (node.implements) {
this.push(" ");
this.space();
this.word("implements");
this.push(" ");
this.space();
this.printList(node.implements, node);
}
@@ -51,7 +51,7 @@ export function ClassProperty(node: Object) {
if (node.static) {
this.word("static");
this.push(" ");
this.space();
}
this.print(node.key, node);
this.print(node.typeAnnotation, node);
@@ -69,12 +69,12 @@ export function ClassMethod(node: Object) {
if (node.static) {
this.word("static");
this.push(" ");
this.space();
}
if (node.kind === "constructorCall") {
this.word("call");
this.push(" ");
this.space();
}
this._method(node);