summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/ast.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r--lib/handlebars/compiler/ast.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index 6789883..5a5f514 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -149,7 +149,8 @@ var AST = {
var original = "",
dig = [],
- depth = 0;
+ depth = 0,
+ depthString = '';
for(var i=0,l=parts.length; i<l; i++) {
var part = parts[i].part;
@@ -160,6 +161,7 @@ var AST = {
throw new Exception("Invalid path: " + original, this);
} else if (part === "..") {
depth++;
+ depthString += '../';
} else {
this.isScoped = true;
}
@@ -172,6 +174,7 @@ var AST = {
this.parts = dig;
this.string = dig.join('.');
this.depth = depth;
+ this.idName = depthString + this.string;
// an ID is simple if it only has one part, and that part is not
// `..` or `this`.
@@ -191,6 +194,7 @@ var AST = {
this.type = "DATA";
this.id = id;
this.stringModeValue = id.stringModeValue;
+ this.idName = '@' + id.stringModeValue;
},
StringNode: function(string, locInfo) {