summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-01-20 17:00:46 -0600
committerkpdecker <kpdecker@gmail.com>2013-01-20 17:00:46 -0600
commitbf201a66c22e2911eaed9e5a7c44013d878dfcda (patch)
tree8be7447d1a3bdd333b0a0abc2d9058b0e47f8faf /lib/handlebars/compiler/compiler.js
parent39cc7c681678fae2f631f93b913ff2a8ae579c6b (diff)
downloadhandlebars.js-bf201a66c22e2911eaed9e5a7c44013d878dfcda.zip
handlebars.js-bf201a66c22e2911eaed9e5a7c44013d878dfcda.tar.gz
handlebars.js-bf201a66c22e2911eaed9e5a7c44013d878dfcda.tar.bz2
Prevent duplication of inline content in append
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 760cba6..5c50ef0 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -578,6 +578,9 @@ Handlebars.JavaScriptCompiler = function() {};
// If `value` is truthy, or 0, it is coerced into a string and appended
// Otherwise, the empty string is appended
append: function() {
+ // Force anything that is inlined onto the stack so we don't have duplication
+ // when we examine local
+ this.flushInline();
var local = this.popStack();
this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
if (this.environment.isSimple) {