You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2020/03/28 14:37:30 UTC

[GitHub] [royale-compiler] yishayw opened a new issue #139: ArrayCollection - comparison of item to null emits setProperty()

yishayw opened a new issue #139: ArrayCollection - comparison of item to null emits setProperty()
URL: https://github.com/apache/royale-compiler/issues/139
 
 
   Test case:
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:mx="library://ns.apache.org/royale/mx"
   		   applicationComplete="init()"
                      width="600" height="400" >
   
   			<fx:Script>
   				<![CDATA[
   					import mx.collections.ArrayCollection;
   
   					private function init():void
   					{
   						var myDp:ArrayCollection = new ArrayCollection();
   						myDp.addItem("hello1");
   						if (myDp[0] != null) // bad line
   						{
   							trace("ok...")
   						} else
   						{
   							trace("not ok")
   						}
   					}
   
   				]]>
   			</fx:Script>
   </mx:Application>
   
   ```
   The line commented with //bad transpiles to:
   
   `  if (myDp.setProperty(0, null)) {`
   
   which yields a 'not ok' result.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [royale-compiler] yishayw commented on issue #139: ArrayCollection - comparison of item to null emits setProperty()

Posted by GitBox <gi...@apache.org>.
yishayw commented on issue #139: ArrayCollection - comparison of item to null emits setProperty()
URL: https://github.com/apache/royale-compiler/issues/139#issuecomment-605456333
 
 
   Workaround is to replace //bad line with
   
   ```
   						var item1:Object = myDp[0];
   						if (item1 != null)
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services