Wow, didn't know you could do this["JSON"] to access a top-level class. I guess that works because of lexical scoping?
I think other places in the SDK use ApplicationDomain.hasDefinition/getDefinition. -Alex ________________________________________ From: jmcl...@apache.org [jmcl...@apache.org] Sent: Sunday, February 23, 2014 10:58 PM To: comm...@flex.apache.org Subject: [1/2] git commit: [flex-sdk] [refs/heads/develop] - Now able to compile on 10.2 and 10.3 which doesn't have JSON support Repository: flex-sdk Updated Branches: refs/heads/develop 4e0fba518 -> 1cfe16837 Now able to compile on 10.2 and 10.3 which doesn't have JSON support Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/daed2dfd Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/daed2dfd Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/daed2dfd Branch: refs/heads/develop Commit: daed2dfd37da70af303883d34780018e06b80b56 Parents: 4e0fba5 Author: Justin Mclean <jmcl...@apache.org> Authored: Mon Feb 24 17:57:45 2014 +1100 Committer: Justin Mclean <jmcl...@apache.org> Committed: Mon Feb 24 17:57:45 2014 +1100 ---------------------------------------------------------------------- .../projects/framework/src/mx/collections/ArrayCollection.as | 2 +- frameworks/projects/framework/src/mx/collections/ArrayList.as | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/daed2dfd/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 9d6f18d..589cc41 100644 --- a/frameworks/projects/framework/src/mx/collections/ArrayCollection.as +++ b/frameworks/projects/framework/src/mx/collections/ArrayCollection.as @@ -158,7 +158,7 @@ public class ArrayCollection extends ListCollectionView implements IExternalizab public function toJSON(s:String):* { var array:Array = toArray(); - return JSON.stringify(array); + return this["JSON"].stringify(array); } /** http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/daed2dfd/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 abdb09b..117793a 100644 --- a/frameworks/projects/framework/src/mx/collections/ArrayList.as +++ b/frameworks/projects/framework/src/mx/collections/ArrayList.as @@ -282,7 +282,7 @@ public class ArrayList extends EventDispatcher public function toJSON(s:String):* { var array:Array = toArray(); - return JSON.stringify(array); + return this["JSON"].stringify(array); } /**