perf(isArray): use native Array.isArray

see benchmark: http://jsperf.com/isarray-performance

Closes #7735
This commit is contained in:
Sebastian Müller
2014-06-06 21:37:28 +02:00
committed by Caitlin Potter
parent 560f00860d
commit 751ebc17f7

View File

@@ -510,10 +510,14 @@ function isDate(value) {
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Array`.
*/
function isArray(value) {
return toString.call(value) === '[object Array]';
}
var isArray = (function() {
if (!isFunction(Array.isArray)) {
return function(value) {
return toString.call(value) === '[object Array]';
};
}
return Array.isArray;
})();
/**
* @ngdoc function