Explicitly label standalone tokens and words.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
export function ClassDeclaration(node: Object) {
|
||||
this.printJoin(node.decorators, node);
|
||||
this.push("class");
|
||||
this.word("class");
|
||||
|
||||
if (node.id) {
|
||||
this.push(" ");
|
||||
@@ -11,7 +11,7 @@ export function ClassDeclaration(node: Object) {
|
||||
|
||||
if (node.superClass) {
|
||||
this.push(" ");
|
||||
this.push("extends");
|
||||
this.word("extends");
|
||||
this.push(" ");
|
||||
this.print(node.superClass, node);
|
||||
this.print(node.superTypeParameters, node);
|
||||
@@ -19,7 +19,7 @@ export function ClassDeclaration(node: Object) {
|
||||
|
||||
if (node.implements) {
|
||||
this.push(" ");
|
||||
this.push("implements");
|
||||
this.word("implements");
|
||||
this.push(" ");
|
||||
this.printList(node.implements, node);
|
||||
}
|
||||
@@ -31,10 +31,10 @@ export function ClassDeclaration(node: Object) {
|
||||
export { ClassDeclaration as ClassExpression };
|
||||
|
||||
export function ClassBody(node: Object) {
|
||||
this.push("{");
|
||||
this.token("{");
|
||||
this.printInnerComments(node);
|
||||
if (node.body.length === 0) {
|
||||
this.push("}");
|
||||
this.token("}");
|
||||
} else {
|
||||
this.newline();
|
||||
|
||||
@@ -50,14 +50,14 @@ export function ClassProperty(node: Object) {
|
||||
this.printJoin(node.decorators, node);
|
||||
|
||||
if (node.static) {
|
||||
this.push("static");
|
||||
this.word("static");
|
||||
this.push(" ");
|
||||
}
|
||||
this.print(node.key, node);
|
||||
this.print(node.typeAnnotation, node);
|
||||
if (node.value) {
|
||||
this.space();
|
||||
this.push("=");
|
||||
this.token("=");
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
@@ -68,12 +68,12 @@ export function ClassMethod(node: Object) {
|
||||
this.printJoin(node.decorators, node);
|
||||
|
||||
if (node.static) {
|
||||
this.push("static");
|
||||
this.word("static");
|
||||
this.push(" ");
|
||||
}
|
||||
|
||||
if (node.kind === "constructorCall") {
|
||||
this.push("call");
|
||||
this.word("call");
|
||||
this.push(" ");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user