Prevent duplication of inline content in append

This commit is contained in:
kpdecker
2013-01-20 17:00:46 -06:00
parent 39cc7c6816
commit bf201a66c2
+3
View File
@@ -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) {