Use stack rather than register for invoke lookup

This commit is contained in:
kpdecker
2013-01-20 17:02:22 -06:00
parent bf201a66c2
commit 94e70043f9
+6 -4
View File
@@ -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]