summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-01-20 17:02:22 -0600
committerkpdecker <kpdecker@gmail.com>2013-01-20 17:04:30 -0600
commit94e70043f98cfc02cc05362b3b65f4165fc10ebd (patch)
tree1c63a78f20d4d17bf8e8bc8fe12523c2cf196791
parentbf201a66c22e2911eaed9e5a7c44013d878dfcda (diff)
downloadhandlebars.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.js10
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]