Make replaceStack always inline

This commit is contained in:
kpdecker
2013-01-20 23:58:42 -06:00
parent 6210d0b040
commit 9ac47df7dd
+6 -6
View File
@@ -677,7 +677,7 @@ Handlebars.JavaScriptCompiler = function() {};
this.replaceStack(function(current) {
return "typeof " + current + " === functionType ? " + current + ".apply(depth0) : " + current;
}, true);
});
},
// [lookup]
@@ -690,7 +690,7 @@ Handlebars.JavaScriptCompiler = function() {};
lookup: function(name) {
this.replaceStack(function(current) {
return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, 'context');
}, true);
});
},
// [lookupData]
@@ -810,7 +810,7 @@ Handlebars.JavaScriptCompiler = function() {};
return name + ' ? ' + name + '.call(' +
helper.callParams + ") " + ": helperMissing.call(" +
helper.helperMissingParams + ")";
}, true);
});
},
// [invokeKnownHelper]
@@ -971,7 +971,7 @@ Handlebars.JavaScriptCompiler = function() {};
}
},
replaceStack: function(callback, allowInline) {
replaceStack: function(callback) {
var prefix = '',
inline = this.isInline(),
stack;
@@ -986,7 +986,7 @@ Handlebars.JavaScriptCompiler = function() {};
stack = top.value;
} else {
// Get or create the current stack name for use by the inline
var name = allowInline && this.stackSlot ? this.topStackName() : this.incrStack();
var name = this.stackSlot ? this.topStackName() : this.incrStack();
prefix = '(' + this.pushStack(name, true) + ' = ' + top + '),';
stack = this.topStack();
@@ -997,7 +997,7 @@ Handlebars.JavaScriptCompiler = function() {};
var item = callback.call(this, stack);
if (inline && allowInline) {
if (inline) {
if (this.inlineStack.length || this.compileStack.length) {
this.popStack();
}