From 629cea497faca8d6114b898361421e8853e6e43b Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 1 Nov 2014 19:29:02 +1100 Subject: [PATCH] move keyword method and restyle variable declarations --- lib/6to5/generator.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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") {