diff options
author | kpdecker <kpdecker@gmail.com> | 2013-01-20 17:02:22 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-01-20 17:04:30 -0600 |
commit | 94e70043f98cfc02cc05362b3b65f4165fc10ebd (patch) | |
tree | 1c63a78f20d4d17bf8e8bc8fe12523c2cf196791 | |
parent | bf201a66c22e2911eaed9e5a7c44013d878dfcda (diff) | |
download | handlebars.js-94e70043f98cfc02cc05362b3b65f4165fc10ebd.zip handlebars.js-94e70043f98cfc02cc05362b3b65f4165fc10ebd.tar.gz handlebars.js-94e70043f98cfc02cc05362b3b65f4165fc10ebd.tar.bz2 |
Use stack rather than register for invoke lookup
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 5c50ef0..7cac316 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] |