You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/04/17 10:28:58 UTC
git commit: [flex-sdk] - FLEX-12202 - Checked boolean works as added
support for IList
Updated Branches:
refs/heads/develop 38122b443 -> 8d08c095f
FLEX-12202 - Checked boolean works as added support for IList
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/8d08c095
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/8d08c095
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/8d08c095
Branch: refs/heads/develop
Commit: 8d08c095fc9cb61deb8d5d334f8a485a0badbe15
Parents: 38122b4
Author: Justin Mclean <jm...@apache.org>
Authored: Wed Apr 17 18:25:33 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Wed Apr 17 18:25:33 2013 +1000
----------------------------------------------------------------------
.../projects/framework/src/mx/utils/ArrayUtil.as | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/8d08c095/frameworks/projects/framework/src/mx/utils/ArrayUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/utils/ArrayUtil.as b/frameworks/projects/framework/src/mx/utils/ArrayUtil.as
index f19587e..c41cccf 100644
--- a/frameworks/projects/framework/src/mx/utils/ArrayUtil.as
+++ b/frameworks/projects/framework/src/mx/utils/ArrayUtil.as
@@ -35,6 +35,8 @@ package mx.utils
public class ArrayUtil
{
include "../core/Version.as";
+
+ import mx.collections.IList;
//--------------------------------------------------------------------------
//
@@ -48,13 +50,15 @@ public class ArrayUtil
* <p>If the Object is already an Array, it returns the object.
* If the object is not an Array, it returns an Array
* in which the only element is the Object.
+ * If the Object implements IList it returns the IList's array.
* As a special case, if the Object is null,
* it returns an empty Array.</p>
*
* @param obj Object that you want to ensure is an array.
*
* @return An Array. If the original Object is already an Array,
- * the original Array is returned. Otherwise, a new Array whose
+ * the original Array is returned. If the original Object is an
+ * IList then it's array is returned. Otherwise, a new Array whose
* only element is the Object is returned or an empty Array if
* the Object was null.
*
@@ -68,8 +72,11 @@ public class ArrayUtil
if (obj == null)
return [];
- else if (obj is Array)
- return obj as Array;
+ else if (obj is Array)
+ return obj as Array;
+
+ else if (obj is IList)
+ return (obj as IList).toArray();
else
return [ obj ];