flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/3] git commit: [flex-falcon] [refs/heads/develop] - More binding fixes
Date Tue, 05 Nov 2013 20:58:29 GMT
Updated Branches:
  refs/heads/develop 7020dcfac -> 325cce668


More binding fixes


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

Branch: refs/heads/develop
Commit: d097b08a832ce6ca6be57f4f8a64f9ec08717b0e
Parents: 525c271
Author: Alex Harui <aharui@apache.org>
Authored: Mon Nov 4 23:32:24 2013 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Nov 5 06:32:22 2013 -0800

----------------------------------------------------------------------
 .../databinding/MXMLBindingDirectiveHelper.java | 30 ++++++++++++++------
 1 file changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d097b08a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
index 7d7d41d..b4ea1c3 100644
--- a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
+++ b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
@@ -163,6 +163,11 @@ public class MXMLBindingDirectiveHelper
             else
                 host.addVariableTrait(IMXMLTypeConstants.NAME_BINDINGS, NAME_ARRAYTYPE);
         }
+        else
+        {
+            makeSpecialMemberVariablesForBinding();
+            isFlexSDK = true;
+        }
         
         if (host.getProject().getTargetSettings().getMxmlChildrenAsData())
             return outputBindingInfoAsData(isFlexSDK);
@@ -211,6 +216,12 @@ public class MXMLBindingDirectiveHelper
             else
                 ret.addInstruction(OP_pushstring, s);
             
+            IExpressionNode destNode = bi.getExpressionNodeForDestination();
+            if (destNode != null)
+                BindingCodeGenUtils.generateSetter(ret, destNode, host.getInstanceScope());
+            else
+                ret.addInstruction(OP_pushnull);
+            
             s = bi.getDestinationString();
             if (s.contains("."))
             {
@@ -219,13 +230,9 @@ public class MXMLBindingDirectiveHelper
                     ret.addInstruction(OP_pushstring, part);
                 ret.addInstruction(OP_newarray, parts.length);
             }
-            else if (s == null || s.length() == 0)
-            {
-                BindingCodeGenUtils.generateSetter(ret, bi.getExpressionNodeForDestination(),
host.getInstanceScope());
-            }
             else
                 ret.addInstruction(OP_pushstring, s);
-            propertyCount += 2;
+            propertyCount += 3;
         }
         Set<Entry<Object, WatcherInfoBase>> watcherChains = bindingDataBase.getWatcherChains();
         if (watcherChains != null)
@@ -242,13 +249,11 @@ public class MXMLBindingDirectiveHelper
         // stack : this, bindings
         ret.addInstruction(OP_swap);
         // stack : bindings, this
-        ret.addInstruction(OP_setproperty, IMXMLTypeConstants.NAME_BINDINGS);
         
         if (isFlexSDK)
-        {
-            ret.addInstruction(OP_getlocal0);
             ret.addInstruction(OP_callpropvoid, IMXMLTypeConstants.ARG_SETUPBINDINGS);
-        }
+        else
+            ret.addInstruction(OP_setproperty, IMXMLTypeConstants.NAME_BINDINGS);
 
         return ret;
     }
@@ -298,6 +303,13 @@ public class MXMLBindingDirectiveHelper
                 ret.addInstruction(OP_pushnull);            // null is valid
             else 
                 ret.addInstruction(OP_newfunction, propertyGetterFunction);
+            if (type == WatcherType.STATIC_PROPERTY)
+            {
+                StaticPropertyWatcherInfo pwinfo = (StaticPropertyWatcherInfo)watcherInfoBase;
+                Name classMName = pwinfo.getContainingClass(host.getProject());
+                ret.addInstruction(OP_getlex, classMName);
+                propertyCount++;
+            }
             propertyCount += 5;
         }
         else if (type == WatcherType.XML)


Mime
View raw message