diff --git a/lib/6to5/generator.js b/lib/6to5/generator.js index 6f48131261..66c62297b7 100644 --- a/lib/6to5/generator.js +++ b/lib/6to5/generator.js @@ -15,13 +15,13 @@ function CodeGenerator(code, ast, opts) { opts = opts || {} this.tabWidth = 2; - this._indent = 0; this.opts = opts; this.ast = ast; this.buf = ""; - this.line = 1; - this.column = 0; + this.line = 1; + this.column = 0; + this._indent = 0; if (opts.sourceMap) { this.map = new sourceMap.SourceMapGenerator({ @@ -61,6 +61,11 @@ CodeGenerator.prototype.semicolon = function () { this.column++; }; +CodeGenerator.prototype.keyword = function (name) { + this.push(name); + this.push(" "); +}; + CodeGenerator.prototype.push = function (str) { if (this._indent) { // we have an indent level and we aren't pushing a newline @@ -151,11 +156,6 @@ CodeGenerator.prototype.print = function (node, parent) { } }; -CodeGenerator.prototype.keyword = function (name) { - this.push(name); - this.push(" "); -}; - CodeGenerator.prototype.generateComment = function (comment) { var val = comment.value; if (comment.type === "Line") {