diff options
author | kpdecker <kpdecker@gmail.com> | 2014-11-27 07:32:15 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-11-27 07:32:15 -0600 |
commit | e1cba432a68fe208782f8f943ebd57d7641d705a (patch) | |
tree | b7fc96a969a0290f953c38ed3a61053da35861e4 /lib/handlebars/compiler/ast.js | |
parent | 5c921cafebee438fa27d417ae701b24323373a30 (diff) | |
download | handlebars.js-e1cba432a68fe208782f8f943ebd57d7641d705a.zip handlebars.js-e1cba432a68fe208782f8f943ebd57d7641d705a.tar.gz handlebars.js-e1cba432a68fe208782f8f943ebd57d7641d705a.tar.bz2 |
Simplify Path and Sexpr calculated flags
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r-- | lib/handlebars/compiler/ast.js | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js index 287a9e5..7530074 100644 --- a/lib/handlebars/compiler/ast.js +++ b/lib/handlebars/compiler/ast.js @@ -69,21 +69,8 @@ var AST = { this.type = "sexpr"; this.hash = hash; - var id = this.id = rawParams[0]; - var params = this.params = rawParams.slice(1); - - // a mustache is definitely a helper if: - // * it is an eligible helper, and - // * it has at least one parameter or hash segment - this.isHelper = !!(params.length || hash); - - // a mustache is an eligible helper if: - // * its id is simple (a single part, not `this` or `..`) - this.eligibleHelper = this.isHelper || id.isSimple; - - // if a mustache is an eligible helper but not a definite - // helper, it is ambiguous, and will be resolved in a later - // pass or at runtime. + this.id = rawParams[0]; + this.params = rawParams.slice(1); }, HashNode: function(pairs, locInfo) { @@ -111,8 +98,6 @@ var AST = { } else if (part === '..') { depth++; depthString += '../'; - } else { - this.isScoped = true; } } else { dig.push(part); @@ -123,10 +108,6 @@ var AST = { this.original = (data ? '@' : '') + original; this.parts = dig; this.depth = depth; - - // an ID is simple if it only has one part, and that part is not - // `..` or `this`. - this.isSimple = parts.length === 1 && !this.isScoped && depth === 0; }, StringNode: function(string, locInfo) { |