diff options
author | kpdecker <kpdecker@gmail.com> | 2013-05-30 15:46:00 -0400 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-05-30 15:47:30 -0400 |
commit | d7b345b2da5436cd3199d9b9fcf51f0af49da77c (patch) | |
tree | 46e38000c1556eb4d3394f6685837e4f43f8af32 /lib/handlebars/compiler/compiler.js | |
parent | 17659b972070ee081987c410f1dbbf569a41f2e1 (diff) | |
download | handlebars.js-d7b345b2da5436cd3199d9b9fcf51f0af49da77c.zip handlebars.js-d7b345b2da5436cd3199d9b9fcf51f0af49da77c.tar.gz handlebars.js-d7b345b2da5436cd3199d9b9fcf51f0af49da77c.tar.bz2 |
Allow execution of helpers on the context
Fixes #285
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 7777456..c003ce6 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -866,8 +866,9 @@ JavaScriptCompiler.prototype = { this.context.aliases.helperMissing = 'helpers.helperMissing'; var helper = this.lastHelper = this.setupHelper(paramSize, name, true); + var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context'); - this.push(helper.name); + this.push(helper.name + ' || ' + nonHelper); this.replaceStack(function(name) { return name + ' ? ' + name + '.call(' + helper.callParams + ") " + ": helperMissing.call(" + |