flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/2] git commit: [flex-falcon] [refs/heads/develop] - fix using _id instead of id for JS localId output
Date Sat, 19 Aug 2017 05:09:22 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 1abf6439b -> 9539c83f6


fix using _id instead of id for JS localId output


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

Branch: refs/heads/develop
Commit: 9cf18a060d20036ff2015efd6803f5b6769795c6
Parents: 1abf643
Author: Alex Harui <aharui@apache.org>
Authored: Fri Aug 18 08:43:35 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Aug 18 08:43:35 2017 -0700

----------------------------------------------------------------------
 .../mxml/flexjs/MXMLDescriptorSpecifier.java    | 14 ++++++++-----
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java  | 21 ++++++++++----------
 2 files changed, 20 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9cf18a06/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
index 9eac5d5..36d6d48 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
@@ -88,6 +88,12 @@ public class MXMLDescriptorSpecifier extends MXMLNodeSpecifier
     public String id;
 
     //---------------------------------
+    //    effectiveId
+    //---------------------------------
+
+    public String effectiveId;
+
+    //---------------------------------
     //    isTopNode
     //---------------------------------
 
@@ -177,17 +183,15 @@ public class MXMLDescriptorSpecifier extends MXMLNodeSpecifier
                 }
             }
 
-            if (id != null)
+            if (id != null || effectiveId != null)
             {
                 write(propertySpecifiers.size() + 1 + "");
                 writeDelimiter(writeNewline);
-                boolean isEffectiveID = id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX.getToken())
||
-                						id.startsWith(MXMLFlexJSEmitterTokens.BINDING_PREFIX.getToken());
-                String idPropName = (isEffectiveID) ? "_id"
+                String idPropName = (effectiveId != null) ? "_id"
                         : "id";
                 writeSimpleDescriptor(idPropName, ASEmitterTokens.TRUE.getToken(),
                         ASEmitterTokens.SINGLE_QUOTE.getToken()
-                                + id + ASEmitterTokens.SINGLE_QUOTE.getToken(),
+                                + ((id != null) ? id : effectiveId) + ASEmitterTokens.SINGLE_QUOTE.getToken(),
                         writeNewline);
     
                 writeDelimiter(writeNewline);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9cf18a06/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 56b49e1..77bbf52 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
@@ -948,8 +948,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
 
         for (MXMLDescriptorSpecifier instance : instances)
         {
-            if (!instance.id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX
-                    .getToken()))
+            if (instance.id != null)
             {
 	        	PackageFooterEmitter.AccessorData data = asEmitter.packageFooterEmitter.new AccessorData();
 	        	accessorData.add(data);
@@ -1122,7 +1121,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
             writeNewline(" */");
             write(ASEmitterTokens.THIS);
             write(ASEmitterTokens.MEMBER_ACCESS);
-            write(instance.id + "_");
+            write((instance.id != null ? instance.id : instance.effectiveId) + "_");
             writeNewline(ASEmitterTokens.SEMICOLON);
         }
     }
@@ -1600,8 +1599,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
     	int n = 0;
         for (MXMLDescriptorSpecifier instance : instances)
         {
-            if (!instance.id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX
-                    .getToken()))
+            if (instance.id != null)
             {
             	n++;
             }
@@ -1618,8 +1616,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         int i = 0;
         for (MXMLDescriptorSpecifier instance : instances)
         {
-            if (!instance.id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX
-                    .getToken()))
+            if (instance.id != null)
             {
                 indentPush();
     	        writeNewline("/** @export */");
@@ -1792,15 +1789,19 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
 
         MXMLDescriptorSpecifier currentPropertySpecifier = getCurrentDescriptor("ps");
 
+        String effectiveId = null;
         String id = node.getID();
         if (id == null)
-            id = node.getEffectiveID();
-        if (id == null)
-            id = MXMLFlexJSEmitterTokens.ID_PREFIX.getToken() + idCounter++;
+        {
+        	effectiveId = node.getEffectiveID();
+        	if (effectiveId == null)
+        		effectiveId = MXMLFlexJSEmitterTokens.ID_PREFIX.getToken() + idCounter++;
+        }
 
         MXMLDescriptorSpecifier currentInstance = new MXMLDescriptorSpecifier();
         currentInstance.isProperty = false;
         currentInstance.id = id;
+        currentInstance.effectiveId = effectiveId;
         currentInstance.name = formatQualifiedName(cdef.getQualifiedName());
         currentInstance.parent = currentPropertySpecifier;
 


Mime
View raw message