fix linting errors

This commit is contained in:
Sebastian McKenzie
2014-10-30 13:26:13 +11:00
parent e797be518f
commit e5ae2f8eaf
3 changed files with 11 additions and 18 deletions

View File

@@ -21,6 +21,7 @@ CodeGenerator.prototype.generate = function (ast, opts) {
CodeGenerator.prototype.buildPrint = function (parent) {
var self = this;
var print = function (node) {
return self.print(node, parent);
};
@@ -138,7 +139,6 @@ CodeGenerator.prototype.ArrowFunctionExpression = function (node, print) {
CodeGenerator.prototype.MethodDefinition = function (node, print) {
throw new Error("MethodDefinition");
return;
};
CodeGenerator.prototype.YieldExpression = function (node, print) {
@@ -189,7 +189,7 @@ CodeGenerator.prototype.BlockStatement = function (node, print) {
if (body.length === 0) {
return "{}";
} else {
return "{\n" + this.indent(print.sequence(body)) + "\n}"
return "{\n" + this.indent(print.sequence(body)) + "\n}";
}
};
@@ -223,7 +223,6 @@ CodeGenerator.prototype.ObjectExpression =
CodeGenerator.prototype.ObjectPattern = function (node, print) {
var allowBreak = false;
var indent = this.indent;
var print = this.buildPrint(node);
var parts = [len > 0 ? "{\n" : "{"];
var len = node.properties.length;
@@ -267,7 +266,6 @@ CodeGenerator.prototype.ArrayExpression =
CodeGenerator.prototype.ArrayPattern = function (node, print) {
var elems = node.elements;
var parts = ["["];
var print = this.buildPrint(node);
var len = elems.length;
_.each(elems, function(elem, i) {
@@ -358,7 +356,6 @@ CodeGenerator.prototype.NewExpression = function (node, print) {
};
CodeGenerator.prototype.VariableDeclaration = function (node, print, parent) {
var print = print;
var code = node.kind + " ";
var maxLen = 0;
@@ -371,6 +368,7 @@ CodeGenerator.prototype.VariableDeclaration = function (node, print, parent) {
switch (maxLen) {
case 0:
code += printed[0];
break;
default:
code += printed.join(",\n ");
@@ -410,7 +408,7 @@ CodeGenerator.prototype.ForStatement = function (node, print) {
var code = "for (";
code += print(node.init) + "; ";
code += print(node.test) + "; ";
code += print(node.update)
code += print(node.update);
code += ") ";
code += print(node.body);
return code;
@@ -559,7 +557,7 @@ CodeGenerator.prototype._method = function (kind, key, value, print) {
);
return parts.join("");
}
};
CodeGenerator.prototype.MethodDefinition = function (node, print) {
var parts = [];