diff --git a/js/JavaScriptParseTree.js b/js/JavaScriptParseTree.js index a86f3831a..17463c089 100644 --- a/js/JavaScriptParseTree.js +++ b/js/JavaScriptParseTree.js @@ -27,112 +27,111 @@ var JavaScriptParseTree = function(tree) { // Render the entire JavaScript tree object to JavaScript source code JavaScriptParseTree.prototype.render = function() { - this.output = []; - this.renderSubTree(this.tree); - var r = this.output.join(""); - this.output = null; + var output = []; + this.renderSubTree(output,this.tree); + var r = output.join(""); return r; }; // Render a subtree of the parse tree to an array of fragments of JavaScript source code -JavaScriptParseTree.prototype.renderSubTree = function(tree) { +JavaScriptParseTree.prototype.renderSubTree = function(output,tree) { for(var t=0; t