fix generation tests and add variable kind length

This commit is contained in:
Sebastian McKenzie
2015-01-08 01:00:32 +11:00
parent a924c9c218
commit 4aba7ec192
7 changed files with 17 additions and 9 deletions

View File

@@ -14,11 +14,11 @@ Buffer.prototype.get = function () {
return util.trimRight(this.buf);
};
Buffer.prototype.getIndent = function (i) {
Buffer.prototype.getIndent = function () {
if (this.format.compact) {
return "";
} else {
return util.repeat(i || this._indent, this.format.indent.style);
return util.repeat(this._indent, this.format.indent.style);
}
};

View File

@@ -1,4 +1,5 @@
var t = require("../../types");
var util = require("../../util");
var t = require("../../types");
exports.WithStatement = function (node, print) {
this.keyword("with");
@@ -169,7 +170,7 @@ exports.VariableDeclaration = function (node, print, parent) {
var sep = ",";
if (inits > noInits) { // more inits than noinits
sep += "\n" + this.getIndent(2);
sep += "\n" + util.repeat(node.kind.length + 1);
} else {
sep += " ";
}