Fixed bug in falsy check on lookups.

This commit is contained in:
Alan Johnson
2011-09-05 11:08:22 -04:00
parent 6b18873d23
commit 33bde69750
+2 -1
View File
@@ -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) {