summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/visitor.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-01-18 13:23:45 -0600
committerkpdecker <kpdecker@gmail.com>2015-01-18 13:23:45 -0600
commitcb51b82b8e8114aaa3e1b19c41e5c4eebf0539d5 (patch)
tree386038a4a43f85e19dfee0f996cce66f10c10d8f /lib/handlebars/compiler/visitor.js
parentb0b522b4f81baf5ba4c190b59abd2b9cfe82bc77 (diff)
downloadhandlebars.js-cb51b82b8e8114aaa3e1b19c41e5c4eebf0539d5.zip
handlebars.js-cb51b82b8e8114aaa3e1b19c41e5c4eebf0539d5.tar.gz
handlebars.js-cb51b82b8e8114aaa3e1b19c41e5c4eebf0539d5.tar.bz2
Add support for dynamic partial names
Uses the subexpression syntax to allow for dynamic partial lookups. Ex: ``` {{> (helper) }} ``` Fixes #933
Diffstat (limited to 'lib/handlebars/compiler/visitor.js')
-rw-r--r--lib/handlebars/compiler/visitor.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/visitor.js b/lib/handlebars/compiler/visitor.js
index 3fb37fb..03af915 100644
--- a/lib/handlebars/compiler/visitor.js
+++ b/lib/handlebars/compiler/visitor.js
@@ -92,6 +92,11 @@ Visitor.prototype = {
this.acceptArray(sexpr.params);
this.acceptKey(sexpr, 'hash');
},
+ PartialExpression: function(partial) {
+ this.acceptRequired(partial, 'name');
+ this.acceptArray(partial.params);
+ this.acceptKey(partial, 'hash');
+ },
PathExpression: function(/* path */) {},