diff --git a/source/Ox/js/Collection.js b/source/Ox/js/Collection.js index 92a024cc..d694b017 100644 --- a/source/Ox/js/Collection.js +++ b/source/Ox/js/Collection.js @@ -462,19 +462,25 @@ Ox.slice Alias for Array.prototype.slice.call Ox.slice = function(value, start, stop) { return Array.prototype.slice.call(value, start, stop); }; -//IE8 returns an empty array if undefined is passed as start, stop -//IE8 returns an array of nulls if a string is passed to Array.prototype.slice.call -if(Ox.slice([1]).length == 0 || Ox.slice('a')[0] == null) { +// IE8 returns an empty array if undefined is passed as stop +// and an array of null values if a string is passed as value. +// Firefox 3.6 returns an array of undefined values +// if a string is passed as value. +if ( + Ox.slice([0]).length == 0 + || Ox.slice('0')[0] === null + || Ox.slice('0')[0] === void 0 +) { Ox.slice = function(value, start, stop) { - if(Ox.typeOf(value) == 'string') - value = value.split('') + if (Ox.typeOf(value) == 'string') { + value = value.split(''); + } return stop === void 0 ? Array.prototype.slice.call(value, start) : Array.prototype.slice.call(value, start, stop); }; } - /*@ Ox.some Tests if one or more elements of a collection meet a given condition Unlike [].some(), Ox.some() works for arrays,