Skip to content

Commit 94e7004

Browse files
committed
Use stack rather than register for invoke lookup
1 parent bf201a6 commit 94e7004

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/handlebars/compiler/compiler.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,13 @@ Handlebars.JavaScriptCompiler = function() {};
779779
this.context.aliases.helperMissing = 'helpers.helperMissing';
780780

781781
var helper = this.lastHelper = this.setupHelper(paramSize, name, true);
782-
this.useRegister('foundHelper');
783782

784-
this.pushStack("(foundHelper = " + helper.name + ") ? foundHelper.call(" +
785-
helper.callParams + ") " + ": helperMissing.call(" +
786-
helper.helperMissingParams + ")");
783+
this.pushStack(helper.name, true);
784+
this.replaceStack(function(name) {
785+
return name + ' ? ' + name + '.call(' +
786+
helper.callParams + ") " + ": helperMissing.call(" +
787+
helper.helperMissingParams + ")";
788+
}, true);
787789
},
788790

789791
// [invokeKnownHelper]

0 commit comments

Comments
 (0)