summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index f1d368b..3405eab 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -623,7 +623,7 @@ Handlebars.JavaScriptCompiler = function() {};
// Looks up the value of `name` on the current context and pushes
// it onto the stack.
lookupOnContext: function(name) {
- this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'));
+ this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'), true);
},
// [pushContext]
@@ -671,7 +671,7 @@ Handlebars.JavaScriptCompiler = function() {};
//
// Push the result of looking up `id` on the current data
lookupData: function(id) {
- this.pushStack(this.nameLookup('data', id, 'data'));
+ this.pushStack(this.nameLookup('data', id, 'data'), true);
},
// [pushStringParam]
@@ -914,8 +914,7 @@ Handlebars.JavaScriptCompiler = function() {};
},
pushStackLiteral: function(item) {
- this.compileStack.push(new Literal(item));
- return item;
+ return this.pushStack(new Literal(item), true);
},
pushStack: function(item, inline) {
@@ -935,6 +934,8 @@ Handlebars.JavaScriptCompiler = function() {};
},
replaceStack: function(callback) {
+ this.flushInline();
+
var stack = this.topStack(),
item = callback.call(this, stack);