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 2014/03/07 02:05:15 UTC

[05/50] git commit: [flex-sdk] [refs/heads/master] - FLEX-34108 changed code so it compile under 10.2/10.3 and still works under 11.0+

FLEX-34108 changed code so it compile under 10.2/10.3 and still works under 11.0+


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/39e52810
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/39e52810
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/39e52810

Branch: refs/heads/master
Commit: 39e5281037b6cd75eceab647630a6138995b5625
Parents: c940664
Author: Justin Mclean <jm...@apache.org>
Authored: Mon Feb 24 19:24:20 2014 +1100
Committer: Justin Mclean <jm...@apache.org>
Committed: Mon Feb 24 19:24:20 2014 +1100

----------------------------------------------------------------------
 .../framework/src/mx/collections/ArrayCollection.as   | 13 +++++++++++--
 .../framework/src/mx/collections/ArrayList.as         | 14 ++++++++++++--
 2 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/39e52810/frameworks/projects/framework/src/mx/collections/ArrayCollection.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ArrayCollection.as b/frameworks/projects/framework/src/mx/collections/ArrayCollection.as
index 589cc41..ab195b9 100644
--- a/frameworks/projects/framework/src/mx/collections/ArrayCollection.as
+++ b/frameworks/projects/framework/src/mx/collections/ArrayCollection.as
@@ -19,7 +19,7 @@
 
 package mx.collections
 {
-
+import flash.system.ApplicationDomain;
 import flash.utils.IDataInput;
 import flash.utils.IDataOutput;
 import flash.utils.IExternalizable;
@@ -158,7 +158,16 @@ public class ArrayCollection extends ListCollectionView implements IExternalizab
 	public function toJSON(s:String):*
 	{
 		var array:Array = toArray();
-		return this["JSON"].stringify(array);
+		
+		if (ApplicationDomain.currentDomain.hasDefinition("JSON"))
+		{
+			var json:Class = Class(ApplicationDomain.currentDomain.getDefinition("JSON"));
+			return json["stringify"](array);
+		}
+		else
+		{
+			return '{"error": "Not supported on Flash Player 10"}';
+		}
 	}
 	
     /**

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/39e52810/frameworks/projects/framework/src/mx/collections/ArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ArrayList.as b/frameworks/projects/framework/src/mx/collections/ArrayList.as
index 117793a..42ac624 100644
--- a/frameworks/projects/framework/src/mx/collections/ArrayList.as
+++ b/frameworks/projects/framework/src/mx/collections/ArrayList.as
@@ -19,9 +19,10 @@
 
 package mx.collections 
 {
-    
+ 
 import flash.events.EventDispatcher;
 import flash.events.IEventDispatcher;
+import flash.system.ApplicationDomain;
 import flash.utils.IDataInput;
 import flash.utils.IDataOutput;
 import flash.utils.IExternalizable;
@@ -282,7 +283,16 @@ public class ArrayList extends EventDispatcher
 	public function toJSON(s:String):*
 	{
 		var array:Array = toArray();
-		return this["JSON"].stringify(array);
+		
+		if (ApplicationDomain.currentDomain.hasDefinition("JSON"))
+		{
+			var json:Class = Class(ApplicationDomain.currentDomain.getDefinition("JSON"));
+			return json["stringify"](array);
+		}
+		else
+		{
+			return '{"error": "Not supported on Flash Player 10"}';
+		}
 	}
 	
     /**