3 fixes: 1) set properties to the full qname.  They can be private and 
protected properties, not just public. 2) don't add style class traits more 
than once if there are multiple fx:Style blocks. 3) If there is no id, set the 
target to null, not empty string.


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

Branch: refs/heads/develop
Commit: ad066ded631e913ef8933f716eca93256711c85e
Parents: ec7cb59
Author: Alex Harui <[email protected]>
Authored: Wed Oct 2 20:47:11 2013 -0700
Committer: Alex Harui <[email protected]>
Committed: Tue Oct 8 13:50:57 2013 -0700

----------------------------------------------------------------------
 .../as/codegen/MXMLClassDirectiveProcessor.java       | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ad066ded/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git 
a/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
 
b/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
index cbf4cf0..a868416 100644
--- 
a/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
+++ 
b/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
@@ -3455,7 +3455,11 @@ public class MXMLClassDirectiveProcessor extends 
ClassDirectiveProcessor
                 // Set the property.
                 // unless it's a databinding, then the property is set 
indiretly
                if (!isDb)
-                    context.addInstruction(OP_setproperty, new 
Name(propertyName));
+               {
+                   IDefinition def = propertyNode.getDefinition();
+                   Name n = ((DefinitionBase)def).getMName(getProject());
+                   context.addInstruction(OP_setproperty, n);
+               }
             }
             
             context.stopUsing(IL.PROPERTIES, 1);
@@ -3928,7 +3932,8 @@ public class MXMLClassDirectiveProcessor extends 
ClassDirectiveProcessor
         }
 
         getProblems().addAll(problems);
-        reducer.visitClassTraits(ctraits);
+        if (!hasStyleTags) // don't duplicate traits if there's a second style 
block
+            reducer.visitClassTraits(ctraits);
         cinitInsns.addAll(reducer.getClassInitializationInstructions());
         hasStyleTags = true;
     }
@@ -4139,7 +4144,10 @@ public class MXMLClassDirectiveProcessor extends 
ClassDirectiveProcessor
             // Set its 'target' property to the id of the object
             // whose property or style this override will set.
             context.addInstruction(OP_dup);
-            context.addInstruction(OP_pushstring, id);
+            if (id.length() == 0)
+                context.addInstruction(OP_pushnull);
+            else
+                context.addInstruction(OP_pushstring, id);
             context.addInstruction(OP_setproperty, NAME_TARGET);
     
             // Set its 'name' property to the name of the property or style.

Reply via email to