diff --git a/source/Ox/js/Fallback.js b/source/Ox/js/Fallback.js index bc929b7f..d1b4db67 100644 --- a/source/Ox/js/Fallback.js +++ b/source/Ox/js/Fallback.js @@ -123,6 +123,19 @@ Ox.fallback.indexOf = function(value) { return ret; }; +/*@ +Ox.fallback.isArray see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray + > Ox.fallback.isArray([]) + true + > Ox.fallback.isArray((function() { return arguments; }())) + false + > Ox.fallback.isArray({0: 0, length: 1}) + false +@*/ +Ox.fallback.isArray = function(value) { + return Object.prototype.toString.call(value) == '[object Array]'; +}; + /*@ Ox.fallback.lastIndexOf see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf > Ox.fallback.lastIndexOf.call([1, 2, 3, 2, 1], 2) @@ -265,6 +278,7 @@ Ox.fallback.trim = function() { var method, object; for (method in Ox.fallback) { object = method == 'bind' ? Function.prototype + : method == 'isArray' ? Array : method == 'keys' ? Object : method == 'trim' ? String.prototype : Array.prototype;