From 94e70043f98cfc02cc05362b3b65f4165fc10ebd Mon Sep 17 00:00:00 2001 From: kpdecker Date: Sun, 20 Jan 2013 17:02:22 -0600 Subject: [PATCH] Use stack rather than register for invoke lookup --- lib/handlebars/compiler/compiler.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 5c50ef010..7cac316ba 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -779,11 +779,13 @@ Handlebars.JavaScriptCompiler = function() {}; this.context.aliases.helperMissing = 'helpers.helperMissing'; var helper = this.lastHelper = this.setupHelper(paramSize, name, true); - this.useRegister('foundHelper'); - this.pushStack("(foundHelper = " + helper.name + ") ? foundHelper.call(" + - helper.callParams + ") " + ": helperMissing.call(" + - helper.helperMissingParams + ")"); + this.pushStack(helper.name, true); + this.replaceStack(function(name) { + return name + ' ? ' + name + '.call(' + + helper.callParams + ") " + ": helperMissing.call(" + + helper.helperMissingParams + ")"; + }, true); }, // [invokeKnownHelper]