This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new ac40c31beb MXMLDataInterpreter: fixed styles/effects/events not 
getting handled for objects that don't implement IStrand
ac40c31beb is described below

commit ac40c31beb3794b1a9d68ffcc9fae3f2d5e041bd
Author: Josh Tynjala <[email protected]>
AuthorDate: Thu Mar 23 10:29:55 2023 -0700

    MXMLDataInterpreter: fixed styles/effects/events not getting handled for 
objects that don't implement IStrand
    
    In particular, this fixes <mx:method> for RemoteObject. It's supposed to 
generate an Operation which has result/fault events, and the listeners were 
being ignored instead of getting added as intended. This would have been broken 
for any class that is an event dispatcher, but not a strand, though, so it's 
certainly an improvement in general, and not just for this particular case.
    
    A future update might consider refactoring generateMXMLObject() and 
initializeStrandBasedObject() to consolidate duplicate code and branch only for 
the strand-specific parts. This should put the output file size back to around 
the original size (and, I suspect, actually smaller than the original size!)
---
 .../org/apache/royale/utils/MXMLDataInterpreter.as | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/MXMLDataInterpreter.as
 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/MXMLDataInterpreter.as
index 4d5393597d..23ea930a10 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/MXMLDataInterpreter.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/MXMLDataInterpreter.as
@@ -120,6 +120,50 @@ public class MXMLDataInterpreter
                 else
                     comp[name] = value;
             }
+
+            m = data[i++]; // num styles
+            for (j = 0; j < m; j++)
+            {
+                name = data[i++];
+                simple = data[i++];
+                value = data[i++];
+                if (simple == null)
+                    value = generateMXMLArray(document, null, value as Array);
+                else if (simple == false)
+                    value = generateMXMLObject(document, value as Array);
+                comp.setStyle(name, value);
+            }
+
+            COMPILE::SWF
+            {
+                m = data[i++]; // num effects
+                for (j = 0; j < m; j++)
+                {
+                    name = data[i++];
+                    simple = data[i++];
+                    value = data[i++];
+                    if (simple == null)
+                        value = generateMXMLArray(document, null, value as 
Array);
+                    else if (simple == false)
+                        value = generateMXMLObject(document, value as Array);
+                    comp.setStyle(name, value);
+                }
+            }
+
+            m = data[i++]; // num events
+            for (j = 0; j < m; j++)
+            {
+                name = data[i++];
+                value = data[i++];
+                COMPILE::SWF
+                {
+                    comp.addEventListener(name, value);
+                }
+                COMPILE::JS
+                {
+                    comp.addEventListener(name, goog.bind(value as Function, 
document));
+                }
+            }
             if (id)
                 document[id] = comp;
 

Reply via email to