Reuse stack var to avoid register

This commit is contained in:
kpdecker
2013-01-19 16:57:54 -06:00
parent 5e20c809dc
commit 3c20641a2e
+1 -2
View File
@@ -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 + '; }');
},