From 04466e3fea61e4753b97356cd9f0f0a5fb6b7a22 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 14 Oct 2014 11:39:15 +1100 Subject: [PATCH] move code generation to new method --- lib/6to5/file.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/6to5/file.js b/lib/6to5/file.js index b940682797..2fcb5012ec 100644 --- a/lib/6to5/file.js +++ b/lib/6to5/file.js @@ -74,7 +74,6 @@ File.prototype.transform = function (ast) { this.ast = ast; var self = this; - var opts = this.opts; _.each(transform.transformers, function (transformer) { transformer.transform(self); @@ -88,6 +87,13 @@ File.prototype.transform = function (ast) { ])); }); + return this.generate(); +}; + +File.prototype.generate = function () { + var opts = this.opts; + var ast = this.ast; + var result = util.generate(ast, opts); if (this.shebang) {