Update isArray_ function and add test coverage

This commit is contained in:
Josh Susser
2010-02-24 19:35:32 -08:00
parent 5e3eb884ca
commit 6ca766d5ea
3 changed files with 20 additions and 11 deletions

View File

@@ -89,11 +89,7 @@ jasmine.getEnv = function() {
* @returns {Boolean}
*/
jasmine.isArray_ = function(value) {
return value &&
typeof value === 'object' &&
typeof value.length === 'number' &&
typeof value.splice === 'function' &&
!(value.propertyIsEnumerable('length'));
return Object.prototype.toString.apply(value) === '[object Array]';
};
/**