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 2022/03/23 13:57:40 UTC

[GitHub] [royale-asjs] yishayw opened a new issue #1183: Initializing XML with explicit constructor messes up toString()

yishayw opened a new issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183


   If you look at this example
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic"
                   xmlns:local="*"
                   pageTitle="HelloWorld"
                   applicationComplete="init()">
       <fx:Declarations>
       </fx:Declarations>
       <fx:Script>
           <![CDATA[
               private function init():void{
                           var saveData:XML = new XML(<type/>);
                           saveData.@id = "1"; //copy the ID if we have one for the edit case.
                           saveData.@label = "test";
                           saveData.@datatype = "String";
                           saveData.@eventLocation = "Location";
                           lbl.text = saveData.toXMLString();
   }
           ]]>
       </fx:Script>
       <js:valuesImpl>
           <js:SimpleCSSValuesImpl />
       </js:valuesImpl>
       <js:initialView>
           <js:View width="100%" height="100%">
               <js:Container width="100%" height="100%" >
                   <js:Label id="lbl" text="Hello World" width="200" />
               </js:Container> 
           </js:View>
       </js:initialView>
    </js:Application>
   ```
   
   The label is empty.
   
   But replacing
   
   `var saveData:XML = new XML(<type/>);`
   
   With 
   
   `var saveData:XML = <type/>;`
   
   Shows the expected 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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] greg-dove commented on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
greg-dove commented on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1076790497


   Actually this does work in AS3. The example is objectively not good code because it is essentially a double construction and provides no incremental value. But in general the constructor should accept XML as well. The problem is that the internal stringificatication is not viable for 'copying' the passed in XML arbitrarily, because XML stringification rules do vary depending on the content being stringified. I can work on this over the coming weekend - from some quick initial testing using the 'copy()' method it has highlighted other areas of need (including compiler support for equality checks). Meanwhile for the example in question, it is simply OK to avoid the double-construction. 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw commented on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
yishayw commented on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1077347130


   > Doesn't `new XML()` require a String?
   
   I guess in Flex that works, though it does seem like a strange way to initialize it. I was working that way on Flex app we're porting. I think @greg-dove  is working on it, so you might want to avoid duplicating the effort.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] Harbs commented on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
Harbs commented on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1076426517


   What does `new XML(<type/>)` compile to? I imagine it would be `new XML(new XML("<type/>"))`?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw edited a comment on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
yishayw edited a comment on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1077347130


   > Doesn't `new XML()` require a String?
   
   I guess in Flex that works, though it does seem like a strange way to initialize it. It was working that way on  a Flex app we're porting. I think @greg-dove  is working on it, so you might want to avoid duplicating the effort.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw commented on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
yishayw commented on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1076410632


   Debugging it a bit, it looks like XML.getNodeRef() fails because name is undefined.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw removed a comment on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
yishayw removed a comment on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1077347130


   > Doesn't `new XML()` require a String?
   
   I guess in Flex that works, though it does seem like a strange way to initialize it. It was working that way on  a Flex app we're porting. I think @greg-dove  is working on it, so you might want to avoid duplicating the effort.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] shahnaeem commented on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
shahnaeem commented on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1077890110


   > What does `new XML(<type/>)` compile to? I imagine it would be `new XML(new XML("<type/>"))`?
   
   yes, it compiles to new XML(new XML("<type/>"))


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] greg-dove commented on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
greg-dove commented on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1081390878


   I do have this fixed locally (with a combination of framework and compiler fixes), but still working on nuances for #1185 as well. I should be able to get both pushed within next 36 hours, with related unit tests.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] Harbs commented on issue #1183: Initializing XML with explicit constructor messes up toString()

Posted by GitBox <gi...@apache.org>.
Harbs commented on issue #1183:
URL: https://github.com/apache/royale-asjs/issues/1183#issuecomment-1076421707


   Doesn't `new XML()` require a String?
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org