diff options
author | kpdecker <kpdecker@gmail.com> | 2015-09-01 00:48:20 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-09-01 00:48:20 -0500 |
commit | e7a64f018ca541a7e0ac8ab2108ed86820bb47b1 (patch) | |
tree | 9680f623156fad643bae1a38ae9de425d8fbd583 /lib/handlebars/compiler/compiler.js | |
parent | 0f5061e44524a431659f0665c4cd7557af9525a0 (diff) | |
parent | 6c45f49b24d63acda37072df464bd670af97a072 (diff) | |
download | handlebars.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.js | 13 |
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) { |