flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - handle child in containers
Date Thu, 09 May 2013 23:45:31 GMT
Updated Branches:
  refs/heads/develop c4431151d -> 3a979882a


handle child in containers


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

Branch: refs/heads/develop
Commit: 3a979882ac5bac34738eaf9dafed2160936d7c48
Parents: c443115
Author: Alex Harui <aharui@apache.org>
Authored: Thu May 9 16:45:09 2013 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu May 9 16:45:22 2013 -0700

----------------------------------------------------------------------
 .../mxml/flexjs/MXMLDescriptorSpecifier.java       |   30 +++++++++++++-
 1 files changed, 27 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/3a979882/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
index e4c98a5..82886f9 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
@@ -55,6 +55,12 @@ public class MXMLDescriptorSpecifier extends MXMLNodeSpecifier
     //    children
     //---------------------------------
 
+    public MXMLDescriptorSpecifier childrenSpecifier;
+
+    //---------------------------------
+    //    properties
+    //---------------------------------
+
     public ArrayList<MXMLDescriptorSpecifier> propertySpecifiers;
 
     //---------------------------------
@@ -155,6 +161,16 @@ public class MXMLDescriptorSpecifier extends MXMLNodeSpecifier
         }
         else
         {
+            for (MXMLDescriptorSpecifier md : propertySpecifiers)
+            {
+                if (md.name != null && md.name.equals("mxmlContent"))
+                {
+                    childrenSpecifier = md;
+                    propertySpecifiers.remove(md);
+                    break;
+                }
+            }
+
             write(propertySpecifiers.size() + 1 + "");
             writeDelimiter(writeNewline);
 
@@ -249,9 +265,10 @@ public class MXMLDescriptorSpecifier extends MXMLNodeSpecifier
             {
                 writeDelimiter(writeNewline);
                 
-                // TODO (erikdebruin) handle child nodes in containers...
-                //                    not yet implemented in FlexJS
-                write(ASEmitterTokens.NULL);
+                if (childrenSpecifier == null)
+                    write(ASEmitterTokens.NULL);
+                else
+                    outputChildren(childrenSpecifier, writeNewline);
             }
             
             boolean isLastChild = parent != null
@@ -264,5 +281,12 @@ public class MXMLDescriptorSpecifier extends MXMLNodeSpecifier
 
         return sb.toString();
     }
+    
+    private void outputChildren(MXMLDescriptorSpecifier children, boolean writeNewline)
+    {
+        write(ASEmitterTokens.SQUARE_OPEN.getToken());
+        write(children.output(false));
+        write(ASEmitterTokens.SQUARE_CLOSE.getToken());
+    }
 
 }


Mime
View raw message