summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/javascript-compiler.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r--lib/handlebars/compiler/javascript-compiler.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js
index 4b9db92..4d950d4 100644
--- a/lib/handlebars/compiler/javascript-compiler.js
+++ b/lib/handlebars/compiler/javascript-compiler.js
@@ -377,11 +377,9 @@ JavaScriptCompiler.prototype = {
// If the `value` is a lambda, replace it on the stack by
// the return value of the lambda
resolvePossibleLambda: function() {
- this.aliases.functionType = '"function"';
+ this.aliases.lambda = 'this.lambda';
- this.replaceStack(function(current) {
- return "typeof " + current + " === functionType ? " + current + ".apply(depth0) : " + current;
- });
+ this.push('lambda(' + this.popStack() + ', depth0)');
},
// [lookup]