Skip to content

Commit

Permalink
Use stack rather than register for invoke lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed Jan 20, 2013
1 parent bf201a6 commit 94e7004
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/handlebars/compiler/compiler.js
Expand Up @@ -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]
Expand Down

0 comments on commit 94e7004

Please sign in to comment.