From 58e45457f26f56c1869a9944dcd5d117f297b5e4 Mon Sep 17 00:00:00 2001 From: hallgren Date: Sun, 1 Apr 2012 18:23:28 +0000 Subject: [PATCH] support.js: add an implementation of Array.isArray for older browsers that lack it --- src/www/minibar/support.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/www/minibar/support.js b/src/www/minibar/support.js index 557a3b41f..f06b8db2a 100644 --- a/src/www/minibar/support.js +++ b/src/www/minibar/support.js @@ -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