diff options
author | kpdecker <kpdecker@gmail.com> | 2015-01-18 17:27:27 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-01-18 17:27:27 -0600 |
commit | 884bf1553663734f22ffcd9d758c9d71d4373bf9 (patch) | |
tree | 55d078077b9c23779858282dfe42dd3a42bd7c0d /lib/handlebars/compiler/visitor.js | |
parent | 999da739a66199483ffc4d82426550aee5ac798f (diff) | |
download | handlebars.js-884bf1553663734f22ffcd9d758c9d71d4373bf9.zip handlebars.js-884bf1553663734f22ffcd9d758c9d71d4373bf9.tar.gz handlebars.js-884bf1553663734f22ffcd9d758c9d71d4373bf9.tar.bz2 |
Avoid direct references to sexpr in statements
This allows us to avoid creating unnecessary AST nodes and avoids things like isHelper.
Side effect of these changes is that @data functions can now have data parameters passed to them.
Diffstat (limited to 'lib/handlebars/compiler/visitor.js')
-rw-r--r-- | lib/handlebars/compiler/visitor.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/handlebars/compiler/visitor.js b/lib/handlebars/compiler/visitor.js index 03af915..4101a4f 100644 --- a/lib/handlebars/compiler/visitor.js +++ b/lib/handlebars/compiler/visitor.js @@ -71,17 +71,24 @@ Visitor.prototype = { }, MustacheStatement: function(mustache) { - this.acceptRequired(mustache, 'sexpr'); + this.acceptRequired(mustache, 'path'); + this.acceptArray(mustache.params); + this.acceptKey(mustache, 'hash'); }, BlockStatement: function(block) { - this.acceptRequired(block, 'sexpr'); + this.acceptRequired(block, 'path'); + this.acceptArray(block.params); + this.acceptKey(block, 'hash'); + this.acceptKey(block, 'program'); this.acceptKey(block, 'inverse'); }, PartialStatement: function(partial) { - this.acceptRequired(partial, 'sexpr'); + this.acceptRequired(partial, 'name'); + this.acceptArray(partial.params); + this.acceptKey(partial, 'hash'); }, ContentStatement: function(/* content */) {}, |