summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-09-01 00:48:20 -0500
committerkpdecker <kpdecker@gmail.com>2015-09-01 00:48:20 -0500
commite7a64f018ca541a7e0ac8ab2108ed86820bb47b1 (patch)
tree9680f623156fad643bae1a38ae9de425d8fbd583 /lib/handlebars/compiler/compiler.js
parent0f5061e44524a431659f0665c4cd7557af9525a0 (diff)
parent6c45f49b24d63acda37072df464bd670af97a072 (diff)
downloadhandlebars.js-e7a64f018ca541a7e0ac8ab2108ed86820bb47b1.zip
handlebars.js-e7a64f018ca541a7e0ac8ab2108ed86820bb47b1.tar.gz
handlebars.js-e7a64f018ca541a7e0ac8ab2108ed86820bb47b1.tar.bz2
Merge branch 'decorators'
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index a689e7d..64af5da 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -156,6 +156,15 @@ Compiler.prototype = {
this.opcode('append');
},
+ DecoratorBlock(decorator) {
+ let program = decorator.program && this.compileProgram(decorator.program);
+ let params = this.setupFullMustacheParams(decorator, program, undefined),
+ path = decorator.path;
+
+ this.useDecorators = true;
+ this.opcode('registerDecorator', params.length, path.original);
+ },
+
PartialStatement: function(partial) {
this.usePartial = true;
@@ -201,6 +210,10 @@ Compiler.prototype = {
this.opcode('append');
}
},
+ Decorator(decorator) {
+ this.DecoratorBlock(decorator);
+ },
+
ContentStatement: function(content) {
if (content.value) {