summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorAlan Johnson <alan@commondream.net>2011-09-05 11:08:22 -0400
committerAlan Johnson <alan@commondream.net>2011-09-05 11:08:22 -0400
commit33bde697503ed8bdaffb6b9d8016cb38008095a3 (patch)
tree5f49ad5e6a757293f3e6ed36752eeb204244e754 /lib/handlebars/compiler/compiler.js
parent6b18873d235bcfe40540d3cf569053f795f01405 (diff)
downloadhandlebars.js-33bde697503ed8bdaffb6b9d8016cb38008095a3.zip
handlebars.js-33bde697503ed8bdaffb6b9d8016cb38008095a3.tar.gz
handlebars.js-33bde697503ed8bdaffb6b9d8016cb38008095a3.tar.bz2
Fixed bug in falsy check on lookups.
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index f174393..4537386 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -532,7 +532,8 @@ Handlebars.JavaScriptCompiler = function() {};
lookup: function(name) {
var topStack = this.topStack();
- this.source.push(topStack + " = " + topStack + " ? " + this.nameLookup(topStack, name, 'context') + " : " + topStack + ";");
+ this.source.push(topStack + " = (" + topStack + " == null || " + topStack + " == undefined || " + topStack + " == false ? " +
+ topStack + " : " + this.nameLookup(topStack, name, 'context') + ");");
},
pushStringParam: function(string) {