summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-01-19 16:57:54 -0600
committerkpdecker <kpdecker@gmail.com>2013-01-19 16:57:54 -0600
commit3c20641a2e02d5fc33cde376b4494ff17d0e8bea (patch)
tree93be6b86ea709bc34bd823fff19d926dc69b9bd0 /lib/handlebars/compiler/compiler.js
parent5e20c809dccdf9c6bcd2bb1acd209542605c2ae4 (diff)
downloadhandlebars.js-3c20641a2e02d5fc33cde376b4494ff17d0e8bea.zip
handlebars.js-3c20641a2e02d5fc33cde376b4494ff17d0e8bea.tar.gz
handlebars.js-3c20641a2e02d5fc33cde376b4494ff17d0e8bea.tar.bz2
Reuse stack var to avoid register
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index b33684b..c0bad8c 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -808,12 +808,11 @@ Handlebars.JavaScriptCompiler = function() {};
var helper = this.setupHelper(0, name);
var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
- this.useRegister('foundHelper');
var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
var nextStack = this.nextStack();
- this.source.push('if (foundHelper = ' + helperName + ') { ' + nextStack + ' = foundHelper.call(' + helper.callParams + '); }');
+ this.source.push('if (' + nextStack + ' = ' + helperName + ') { ' + nextStack + ' = ' + nextStack + '.call(' + helper.callParams + '); }');
this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '.apply(depth0) : ' + nextStack + '; }');
},