diff options
author | kpdecker <kpdecker@gmail.com> | 2013-01-20 17:00:46 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-01-20 17:00:46 -0600 |
commit | bf201a66c22e2911eaed9e5a7c44013d878dfcda (patch) | |
tree | 8be7447d1a3bdd333b0a0abc2d9058b0e47f8faf /lib/handlebars/compiler/compiler.js | |
parent | 39cc7c681678fae2f631f93b913ff2a8ae579c6b (diff) | |
download | handlebars.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.js | 3 |
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) { |