Use native Array.isArray when available; currently present in nightly webkit (up to 17x faster) and Opera 10.5 alpha (up to 5x faster).

This commit is contained in:
Juriy Zaytsev 2009-12-22 18:05:30 -05:00
parent d6ed7efe94
commit 647d93bcc4
2 changed files with 8 additions and 2 deletions

View File

@ -217,7 +217,13 @@
function isArray(object) {
return _toString.call(object) == "[object Array]";
}
var hasNativeIsArray = (typeof Array.isArray == 'function')
&& Array.isArray([]) && !Array.isArray({});
if (hasNativeIsArray) {
isArray = Array.isArray;
}
/**
* Object.isHash(object) -> Boolean

2
vendor/pdoc vendored

@ -1 +1 @@
Subproject commit e976b844144666113008a9159fa501f8f575bd1c
Subproject commit 147250bd65eed627e32ca5a70b57fe4f7803ab4b