move class property code gen to classes file
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
export function ClassDeclaration(node, print) {
|
||||
if (node.decorators && node.decorators.length) {
|
||||
print.list(node.decorators);
|
||||
}
|
||||
|
||||
print.list(node.decorators);
|
||||
this.push("class");
|
||||
|
||||
if (node.id) {
|
||||
@@ -44,10 +41,24 @@ export function ClassBody(node, print) {
|
||||
}
|
||||
}
|
||||
|
||||
export function MethodDefinition(node, print) {
|
||||
if (node.decorators && node.decorators.length) {
|
||||
print.list(node.decorators);
|
||||
|
||||
export function ClassProperty(node, print) {
|
||||
print.list(node.decorators);
|
||||
|
||||
if (node.static) this.push("static ");
|
||||
print(node.key);
|
||||
print(node.typeAnnotation);
|
||||
if (node.value) {
|
||||
this.space();
|
||||
this.push("=");
|
||||
this.space();
|
||||
print(node.value);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
export function MethodDefinition(node, print) {
|
||||
print.list(node.decorators);
|
||||
|
||||
if (node.static) {
|
||||
this.push("static ");
|
||||
|
||||
@@ -14,13 +14,6 @@ export function BooleanTypeAnnotation(node) {
|
||||
this.push("bool");
|
||||
}
|
||||
|
||||
export function ClassProperty(node, print) {
|
||||
if (node.static) this.push("static ");
|
||||
print(node.key);
|
||||
print(node.typeAnnotation);
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
export function DeclareClass(node, print) {
|
||||
this.push("declare class ");
|
||||
this._interfaceish(node, print);
|
||||
|
||||
Reference in New Issue
Block a user