Hi again,
Sorry, I was talking about Prototype 1.7's version of `isArray`. I
suddenly had a thought just now, so I checked and found that Prototype
1.6 used a different (and naive) definition which has known issues;
presumably those issues are why 1.7's version has been updated. So if
you're using 1.6, you may well see a false negative on a real array
instance. (Specifically, any array received from another window will
result in a false negative.) I'm surprised that 1.6 had that problem,
but it's good to see that 1.7 fixes it.
If you want to apply the fix to your projects without upgrading from
1.6 to 1.7, here's a cheap and easy way:
(function() {
var toString = Object.prototype.toString;
Object.isArray = function(obj) {
return toString.call(obj) === "[object Array]"; //
Capitalization matters
};
})();
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com