@@ -886,21 +886,28 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
},
|
||||
|
||||
pushStack: function(item) {
|
||||
this.source.push(this.incrStack() + " = " + item + ";");
|
||||
this.compileStack.push("stack" + this.stackSlot);
|
||||
return "stack" + this.stackSlot;
|
||||
var stack = this.incrStack();
|
||||
this.source.push(stack + " = " + item + ";");
|
||||
this.compileStack.push(stack);
|
||||
return stack;
|
||||
},
|
||||
|
||||
replaceStack: function(callback) {
|
||||
var item = callback.call(this, this.topStack());
|
||||
var stack = this.topStack(),
|
||||
item = callback.call(this, stack);
|
||||
|
||||
this.source.push(this.topStack() + " = " + item + ";");
|
||||
return "stack" + this.stackSlot;
|
||||
// Prevent modification of the context depth variable. Through replaceStack
|
||||
if (this.compileStack.length <= 1) {
|
||||
stack = this.nextStack();
|
||||
}
|
||||
|
||||
this.source.push(stack + " = " + item + ";");
|
||||
return stack;
|
||||
},
|
||||
|
||||
nextStack: function(skipCompileStack) {
|
||||
var name = this.incrStack();
|
||||
this.compileStack.push("stack" + this.stackSlot);
|
||||
this.compileStack.push(name);
|
||||
return name;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user