From 17cd2f9f8d45fd98f7025d977bcc7199c2d6a39e Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Thu, 24 Jan 2008 01:33:28 +0000 Subject: [PATCH] prototype: Make Object.isArray correctly identify arrays created in another frame. Closes #10374. --- CHANGELOG | 2 ++ src/base.js | 3 ++- test/unit/base.html | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d95b16a..ce3d9bf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Make Object.isArray correctly identify arrays created in another frame. Closes #10374. [pointy, Dean Edwards, Andrew Dupont, Tobie Langel] + * Fixed issue where Element#match failed on attribute selectors with single or double quotes. Closes #10067. [Cezary Okupski, Andrew Dupont] * Add tests for Element#match. [Tobie Langel] diff --git a/src/base.js b/src/base.js index 9884aaf..2d75f32 100644 --- a/src/base.js +++ b/src/base.js @@ -132,7 +132,8 @@ Object.extend(Object, { }, isArray: function(object) { - return object && object.constructor === Array; + return object != null && typeof object == "object" && + 'splice' in object && 'join' in object; }, isHash: function(object) { diff --git a/test/unit/base.html b/test/unit/base.html index 9828428..51c8e95 100644 --- a/test/unit/base.html +++ b/test/unit/base.html @@ -22,7 +22,12 @@
-
+
+