diff options
author | kpdecker <kpdecker@gmail.com> | 2014-07-13 07:24:52 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-08-12 14:41:58 -0500 |
commit | 60701790099d3c4b30c32d498b05c46fa323df30 (patch) | |
tree | 0edb2f46fbd9aa0016b3d6b61721a9db7ce92974 /lib/handlebars/compiler/ast.js | |
parent | 4a4dcf16578f28bff42d755da5ece94188f75ba5 (diff) | |
download | handlebars.js-60701790099d3c4b30c32d498b05c46fa323df30.zip handlebars.js-60701790099d3c4b30c32d498b05c46fa323df30.tar.gz handlebars.js-60701790099d3c4b30c32d498b05c46fa323df30.tar.bz2 |
Track root status in ProgramNode constructor
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r-- | lib/handlebars/compiler/ast.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js index e388e54..74f276e 100644 --- a/lib/handlebars/compiler/ast.js +++ b/lib/handlebars/compiler/ast.js @@ -9,12 +9,12 @@ function LocationInfo(locInfo){ } var AST = { - ProgramNode: function(statements, inverseStrip, inverse, locInfo) { + ProgramNode: function(isRoot, statements, inverseStrip, inverse, locInfo) { var inverseLocationInfo, firstInverseNode; - if (arguments.length === 3) { + if (arguments.length === 4) { locInfo = inverse; inverse = null; - } else if (arguments.length === 2) { + } else if (arguments.length === 3) { locInfo = inverseStrip; inverseStrip = null; } @@ -33,9 +33,9 @@ var AST = { last_column: firstInverseNode.lastColumn, first_column: firstInverseNode.firstColumn }; - this.inverse = new AST.ProgramNode(inverse, inverseStrip, inverseLocationInfo); + this.inverse = new AST.ProgramNode(isRoot, inverse, inverseStrip, inverseLocationInfo); } else { - this.inverse = new AST.ProgramNode(inverse, inverseStrip); + this.inverse = new AST.ProgramNode(isRoot, inverse, inverseStrip); } this.strip.right = inverseStrip.left; } else if (inverseStrip) { @@ -142,7 +142,7 @@ var AST = { this.type = 'block'; this.mustache = mustache; - this.program = new AST.ProgramNode([content], locInfo); + this.program = new AST.ProgramNode(false, [content], locInfo); }, ContentNode: function(string, locInfo) { |