flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Added support for E4X filtering expressions
Date Mon, 11 Apr 2016 12:06:05 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop d4dc652c9 -> fd1ae8ee6


Added support for E4X filtering expressions


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

Branch: refs/heads/develop
Commit: fd1ae8ee61bc1a1ed109782fd975efc4937e2be0
Parents: d4dc652
Author: Harbs <harbs@in-tools.com>
Authored: Mon Apr 11 15:06:00 2016 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Mon Apr 11 15:06:00 2016 +0300

----------------------------------------------------------------------
 .../projects/XML/src/main/flex/XMLList.as       | 23 ++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd1ae8ee/frameworks/projects/XML/src/main/flex/XMLList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/src/main/flex/XMLList.as b/frameworks/projects/XML/src/main/flex/XMLList.as
index d507033..ea7b4ec 100644
--- a/frameworks/projects/XML/src/main/flex/XMLList.as
+++ b/frameworks/projects/XML/src/main/flex/XMLList.as
@@ -249,8 +249,14 @@ package
 				throw new TypeError("invalid type");
 
 			var item:XML;
-			for each(item in list)
-				appendChild(item);
+			//work-around for FLEX-35070
+			var len:int = list.length();
+			var i:int=0;
+			while(i<len)
+				appendChild(list[i++]);
+
+//			for each(item in list)
+//				appendChild(item);
 				
 			return this;
 		}
@@ -361,6 +367,19 @@ package
 			*/
 			return false;
 		}
+		COMPILE::JS
+		public function filter(callback:Function):XMLList
+		{
+			var list:XMLList = new XMLList();
+			for(var i:int = 0;i<_xmlArray.length;i++)
+			{
+				if(callback(_xmlArray[i]))
+					list.appendChild(_xmlArray[i]);
+			}
+			list.targetObject = _targetObject;
+			list.targetProperty = _targetProperty;
+			return list;
+		}
 		
 		COMPILE::JS
 		public function hasComplexContent():Boolean


Mime
View raw message