flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [4/9] git commit: [flex-falcon] [refs/heads/develop] - fix requires for internal components
Date Mon, 11 Jan 2016 18:04:47 GMT
fix requires for internal components


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

Branch: refs/heads/develop
Commit: 30524516b6e4dd13c339286f69f46c83bace2077
Parents: 17d59a9
Author: Alex Harui <aharui@apache.org>
Authored: Fri Jan 8 14:30:08 2016 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Jan 8 14:30:08 2016 -0800

----------------------------------------------------------------------
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java    | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/30524516/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
index f9f05a4..dd18a90 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
@@ -1764,7 +1764,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
     public void emitFactory(IMXMLFactoryNode node)
     {
         MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
-        ps.value = formatQualifiedName("new org.apache.flex.core.ClassFactory(");
+        ps.value = "new " + formatQualifiedName("org.apache.flex.core.ClassFactory") + "(";
 
         IASNode cnode = node.getChild(0);
         if (cnode instanceof IMXMLClassNode)
@@ -1780,9 +1780,9 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
     public void emitComponent(IMXMLComponentNode node)
     {
         MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
-        ps.value = formatQualifiedName("new org.apache.flex.core.ClassFactory(");
+        ps.value = "new " + formatQualifiedName("org.apache.flex.core.ClassFactory") + "(";
 
-        ps.value += node.getName();
+        ps.value += formatQualifiedName(node.getName());
         ps.value += ")";
         
         setBufferWrite(true);
@@ -1881,7 +1881,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
                 if (NativeUtils.isNative(imp))
                     continue;
     
-                String formatted = formatQualifiedName(imp);
+                String formatted = formatQualifiedName(imp, false);
                 if (writtenInstances.indexOf(formatted) == -1)
                 {
                     emitHeaderLine(imp);
@@ -1919,7 +1919,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
                 : JSGoogEmitterTokens.GOOG_REQUIRE);
         write(ASEmitterTokens.PAREN_OPEN);
         write(ASEmitterTokens.SINGLE_QUOTE);
-        write(formatQualifiedName(qname));
+        write(formatQualifiedName(qname, false));
         write(ASEmitterTokens.SINGLE_QUOTE);
         write(ASEmitterTokens.PAREN_CLOSE);
         writeNewline(ASEmitterTokens.SEMICOLON);
@@ -2001,12 +2001,18 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
 
     protected String formatQualifiedName(String name)
     {
+    	return formatQualifiedName(name, true);
+    }
+    
+    protected String formatQualifiedName(String name, boolean useName)
+    {
     	/*
     	if (name.contains("goog.") || name.startsWith("Vector."))
     		return name;
     	name = name.replaceAll("\\.", "_");
     	*/
-    	usedNames.add(name);
+		if (useName && !usedNames.contains(name))
+			usedNames.add(name);
     	return name;
     }
 


Mime
View raw message