Skip to content
Browse files

safer but slower toArray fallback, in light of .callee throwing in st…

…rict mode.
  • Loading branch information...
1 parent a890afe commit b3a373a7166716bacef4643ad35254bd1993b3d5 @jashkenas jashkenas committed Dec 20, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 underscore.js
View
2 underscore.js
@@ -590,7 +590,7 @@
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
- return !!(obj && obj.concat && obj.unshift && !obj.callee);
+ return toString.call(obj) === '[object Array]';
};
// Is a given variable an arguments object?

0 comments on commit b3a373a

Please sign in to comment.
Something went wrong with that request. Please try again.