support.js: add an implementation of Array.isArray for older browsers that lack it

This commit is contained in:
hallgren
2012-04-01 18:23:28 +00:00
parent 836b5f6afa
commit 58e45457f2

View File

@@ -12,6 +12,14 @@ function bind(f, this_value) {
return function () {return f.apply (this_value, arguments)};
};
// Implement Array.isArray for older browsers that lack it.
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
if(!Array.isArray) {
Array.isArray = function (arg) {
return Object.prototype.toString.call(arg) == '[object Array]';
};
}
/* --- JSONP ---------------------------------------------------------------- */
// Inspired by the function jsonp from