Got detecting Arrays working in firefox.

This commit is contained in:
Alan Johnson
2010-09-11 09:48:17 -04:00
parent 6f35bf4e83
commit 2c3b97bb66
+3 -1
View File
@@ -192,16 +192,18 @@ Handlebars.SafeString.prototype.toString = function() {
Handlebars.helperMissing = function(object, fn) {
var ret = "";
console.log(object);
if(object === true) {
return fn(this);
} else if(object === false) {
return "";
} else if(toString.call(object) === "[object Array]") {
} else if(object.constructor === Array) {
for(var i=0, j=object.length; i<j; i++) {
ret = ret + fn(object[i]);
}
return ret;
} else {
console.log("HERE!");
return fn(object);
}
};