summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-02-16 16:18:17 -0600
committerkpdecker <kpdecker@gmail.com>2013-02-16 16:18:17 -0600
commitd6f146f8a5b1d4386363a1566ef78db7214ab1ed (patch)
tree9c5da1eae0f209d3a26b9e588b7cab4acc92c900 /lib/handlebars/compiler/compiler.js
parent1f00504d257872d5f3096f4d67b710a7f4600f39 (diff)
downloadhandlebars.js-d6f146f8a5b1d4386363a1566ef78db7214ab1ed.zip
handlebars.js-d6f146f8a5b1d4386363a1566ef78db7214ab1ed.tar.gz
handlebars.js-d6f146f8a5b1d4386363a1566ef78db7214ab1ed.tar.bz2
Fix #428 nested if else rendering
The program equality checker was not taking children into account when determining equality, causing breakages under similar cases.
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 2ab1b73..196ba18 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -59,6 +59,17 @@ Compiler.prototype = {
}
}
}
+
+ len = this.children.length;
+ if (other.children.length !== len) {
+ return false;
+ }
+ for (i = 0; i < len; i++) {
+ if (!this.children[i].equals(other.children[i])) {
+ return false;
+ }
+ }
+
return true;
},