node_modules/babel-generator/lib/generators/classes.js in babel-schmooze-sprockets-0.1.2 vs node_modules/babel-generator/lib/generators/classes.js in babel-schmooze-sprockets-0.1.3
- old
+ new
@@ -1,44 +1,48 @@
-/*istanbul ignore next*/"use strict";
+"use strict";
exports.__esModule = true;
exports.ClassDeclaration = ClassDeclaration;
-/*istanbul ignore next*/exports.ClassBody = ClassBody;
-/*istanbul ignore next*/exports.ClassProperty = ClassProperty;
-/*istanbul ignore next*/exports.ClassMethod = ClassMethod;
+exports.ClassBody = ClassBody;
+exports.ClassProperty = ClassProperty;
+exports.ClassMethod = ClassMethod;
function ClassDeclaration(node) {
- this.printJoin(node.decorators, node, { separator: "" });
- this.push("class");
+ this.printJoin(node.decorators, node);
+ 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(" extends ");
+ this.space();
+ this.word("extends");
+ this.space();
this.print(node.superClass, node);
this.print(node.superTypeParameters, node);
}
if (node.implements) {
- this.push(" implements ");
- this.printJoin(node.implements, node, { separator: ", " });
+ this.space();
+ this.word("implements");
+ this.space();
+ this.printList(node.implements, node);
}
this.space();
this.print(node.body, node);
}
-/*istanbul ignore next*/exports.ClassExpression = ClassDeclaration;
+exports.ClassExpression = ClassDeclaration;
function ClassBody(node) {
- this.push("{");
+ this.token("{");
this.printInnerComments(node);
if (node.body.length === 0) {
- this.push("}");
+ this.token("}");
} else {
this.newline();
this.indent();
this.printSequence(node.body, node);
@@ -47,32 +51,37 @@
this.rightBrace();
}
}
function ClassProperty(node) {
- this.printJoin(node.decorators, node, { separator: "" });
+ this.printJoin(node.decorators, node);
- if (node.static) this.push("static ");
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
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);
}
this.semicolon();
}
function ClassMethod(node) {
- this.printJoin(node.decorators, node, { separator: "" });
+ this.printJoin(node.decorators, node);
if (node.static) {
- this.push("static ");
+ this.word("static");
+ this.space();
}
if (node.kind === "constructorCall") {
- this.push("call ");
+ this.word("call");
+ this.space();
}
this._method(node);
}
\ No newline at end of file