flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [07/12] git commit: [flex-falcon] [refs/heads/develop] - [IMRPOVEMENT] Fixes private bindings. Make use of isSourceSimplePublicProperty on BindingInfo, to generate simple string sources, otherwise generate getter functions for private vars/consts also, r
Date Tue, 30 Aug 2016 07:30:30 GMT
[IMRPOVEMENT] Fixes private bindings. Make use of isSourceSimplePublicProperty on BindingInfo,
to generate simple string sources, otherwise generate getter functions for private vars/consts
also, removes an annotation error from bindable implementations in BindableEmitter


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

Branch: refs/heads/develop
Commit: 503f72118975de7f832ffcf7bbfc2613b678c51c
Parents: 53071a7
Author: greg-dove <greg.dove@gmail.com>
Authored: Fri Aug 26 16:46:33 2016 +1200
Committer: greg-dove <greg.dove@gmail.com>
Committed: Sat Aug 27 15:54:14 2016 +1200

----------------------------------------------------------------------
 .../internal/codegen/js/jx/BindableEmitter.java |  4 ---
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java  | 30 ++++++++++----------
 .../databinding/MXMLBindingDirectiveHelper.java | 13 +++++----
 3 files changed, 22 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/503f7211/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
index 1818867..e01ba88 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
@@ -118,7 +118,6 @@ public class BindableEmitter extends JSSubEmitter implements
         emitBindableInterfaceMethod(qname,
                 new String[]{ "/**",
                         " * @export",
-                        " * @private",
                         " * @param {string} type",
                         " * @param {function(?):?}",
                         " * @param {boolean=} opt_capture",
@@ -130,7 +129,6 @@ public class BindableEmitter extends JSSubEmitter implements
         emitBindableInterfaceMethod(qname,
                 new String[]{ "/**",
                         " * @export",
-                        " * @private",
                         " * @param {string} type",
                         " * @param {function(?):?}",
                         " * @param {boolean=} opt_capture",
@@ -142,7 +140,6 @@ public class BindableEmitter extends JSSubEmitter implements
         emitBindableInterfaceMethod(qname,
                 new String[]{ "/**",
                         " * @export",
-                        " * @private",
                         " * @param {"+EVENT_QNAME+"} e",
                         " * @return {boolean}",
                         " */"},
@@ -152,7 +149,6 @@ public class BindableEmitter extends JSSubEmitter implements
         emitBindableInterfaceMethod(qname,
                 new String[]{ "/**",
                         " * @export",
-                        " * @private",
                         " * @param {string} type",
                         " * @return {boolean}",
                         " */"},

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/503f7211/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
index cf4d61c..e451ca0 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
@@ -746,22 +746,9 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         {
             String s;
             s = bi.getSourceString();
-            if (s == null)
+            if (s == null && bi.isSourceSimplePublicProperty())
                 s = getSourceStringFromGetter(bi.getExpressionNodesForGetter());
-            if (s.contains("."))
-            {
-                String[] parts = s.split("\\.");
-                write(ASEmitterTokens.SQUARE_OPEN.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken()
+ 
-                        parts[0] + ASEmitterTokens.DOUBLE_QUOTE.getToken());
-                int n = parts.length;
-                for (int i = 1; i < n; i++)
-                {
-                    String part = parts[i];
-                    write(", " +  ASEmitterTokens.DOUBLE_QUOTE.getToken() + part + ASEmitterTokens.DOUBLE_QUOTE.getToken());
-                }
-                writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
-            }
-            else if (s == null || s.length() == 0)
+            if (s == null || s.length() == 0)
             {
                 List<IExpressionNode> getterNodes = bi.getExpressionNodesForGetter();
                 StringBuilder sb = new StringBuilder();
@@ -784,6 +771,19 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
                 sb.append("; },");
                 writeNewline(sb.toString());
             }
+            else if (s.contains("."))
+            {
+                String[] parts = s.split("\\.");
+                write(ASEmitterTokens.SQUARE_OPEN.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken()
+
+                        parts[0] + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                int n = parts.length;
+                for (int i = 1; i < n; i++)
+                {
+                    String part = parts[i];
+                    write(", " +  ASEmitterTokens.DOUBLE_QUOTE.getToken() + part + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                }
+                writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+            }
             else
                 writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + s + 
                         ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/503f7211/compiler/src/main/java/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
b/compiler/src/main/java/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
index 08573c0..b023ba3 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
@@ -204,19 +204,20 @@ public class MXMLBindingDirectiveHelper
         {
             String s;
             s = bi.getSourceString();
-            if (s == null)
+            if (s == null && bi.isSourceSimplePublicProperty())
                 s = getSourceStringFromGetter(bi.getExpressionNodesForGetter());
-            if (s.contains(".") && !isFlexSDK)
+
+            if (s == null || s.length() == 0 || isFlexSDK)
+            {
+                BindingCodeGenUtils.generateGetter(emitter, ret, bi.getExpressionNodesForGetter(),
host.getInstanceScope());
+            }
+            else if (s.contains(".") && !isFlexSDK)
             {
                 String[] parts = s.split("\\.");
                 for (String part : parts)
                     ret.addInstruction(OP_pushstring, part);
                 ret.addInstruction(OP_newarray, parts.length);
             }
-            else if (s == null || s.length() == 0 || isFlexSDK)
-            {
-                BindingCodeGenUtils.generateGetter(emitter, ret, bi.getExpressionNodesForGetter(),
host.getInstanceScope());
-            }
             else
                 ret.addInstruction(OP_pushstring, s);
             


Mime
View raw message