From b3a373a7166716bacef4643ad35254bd1993b3d5 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Mon, 20 Dec 2010 17:39:57 -0500 Subject: [PATCH] safer but slower toArray fallback, in light of .callee throwing in strict mode. --- underscore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underscore.js b/underscore.js index 1f18e1e61..163268888 100644 --- a/underscore.js +++ b/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?