From 3c20641a2e02d5fc33cde376b4494ff17d0e8bea Mon Sep 17 00:00:00 2001 From: kpdecker Date: Sat, 19 Jan 2013 16:57:54 -0600 Subject: [PATCH] Reuse stack var to avoid register --- lib/handlebars/compiler/compiler.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index b33684b3..c0bad8cb 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 + '; }'); },