flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harbs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-35070) "for each" not working in XMLList
Date Mon, 11 Apr 2016 15:53:25 GMT

    [ https://issues.apache.org/jira/browse/FLEX-35070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15235337#comment-15235337
] 

Harbs commented on FLEX-35070:
------------------------------

		COMPILE::JS
		public function concat(list:*):XMLList
		{
			if(list is XML)
			{
				var newList:XMLList = new XMLList();
				newList.appendChild(list);
				list = newList;
			}
			if(!(list is XMLList))
				throw new TypeError("invalid type");

			var item:XML;
			for each(item in list)
				appendChild(item);
				
			return this;
		}

compiles into:

XMLList.prototype.concat = function(list) {
  if (org.apache.flex.utils.Language.is(list, XML)) {
    var /** @type {XMLList} */ newList = new XMLList();
    newList.appendChild(list);
    list = newList;
  }
  if (!org.apache.flex.utils.Language.is(list, XMLList))
    throw new TypeError("invalid type");
  var /** @type {XML} */ item;
  var foreachiter0_target = list;
  for (var foreachiter0 in foreachiter0_target) 
  {
  item = foreachiter0_target[foreachiter0];
  
    this.appendChild(item);}
  
  return this;
};


> "for each" not working in XMLList
> ---------------------------------
>
>                 Key: FLEX-35070
>                 URL: https://issues.apache.org/jira/browse/FLEX-35070
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: FalconJX
>    Affects Versions: Apache FalconJX 0.6.0
>            Reporter: Harbs
>
> I don't have a full test case right now, but I believe the following will fail.
> var newList:XMLList = new XMLList();
> newList.appendChild(<foo/>);
> var xmlItem:XML;
> for each(xmlItem in oldList)
>   newList.appendChild(xmlItem);
> If necessary, I can put together a (non)working test case.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message