flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/5] git commit: [flex-falcon] [refs/heads/develop] - switch from org.apache. to org_apache_ because of Google Closure Compiler handling of dot-path expressions
Date Wed, 28 Jan 2015 17:21:55 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop eeaab7f1d -> 743fe1571


switch from org.apache. to org_apache_ because of Google Closure Compiler handling of dot-path
expressions


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

Branch: refs/heads/develop
Commit: 46a3d288ece306c4667e81ccb3f31ba23a0eb5b0
Parents: eeaab7f
Author: Alex Harui <aharui@apache.org>
Authored: Tue Jan 27 14:41:32 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Jan 27 14:41:32 2015 -0800

----------------------------------------------------------------------
 .../codegen/js/flexjs/JSFlexJSDocEmitter.java   | 13 ++++-
 .../codegen/js/flexjs/JSFlexJSEmitter.java      | 59 +++++++++++---------
 .../js/flexjs/JSFlexJSEmitterTokens.java        |  2 +-
 .../codegen/js/goog/JSGoogDocEmitter.java       | 12 +++-
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java  | 54 ++++++++++--------
 .../js/flexjs/JSCSSCompilationSession.java      | 17 +++++-
 .../compiler/internal/graph/GoogDepsWriter.java | 10 ++--
 7 files changed, 105 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/46a3d288/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
index 63fafe5..5b3eba4 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
@@ -68,7 +68,17 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
     		if (classIgnoreList.contains(pname + "." + name))
     			return IASLanguageConstants.Object;
     	}
-    	return super.convertASTypeToJS(name, pname);
+    	name = super.convertASTypeToJS(name, pname);
+    	return formatQualifiedName(name);
+    }
+    
+    @Override
+    protected String formatQualifiedName(String name)
+    {
+    	if (name.contains("goog."))
+    		return name;
+    	name = name.replaceAll("\\.", "_");
+    	return name;
     }
 
     @Override
@@ -325,5 +335,4 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
         end();
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/46a3d288/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
index d1afba4..ce77fb9 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -161,7 +161,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
                 String qname = definition.getQualifiedName();
                 if (qname != null && !qname.equals(""))
                 {
-                    write(qname);
+                    write(formatQualifiedName(qname));
                     write(ASEmitterTokens.SPACE);
                     writeToken(ASEmitterTokens.EQUAL);
                     write(ASEmitterTokens.FUNCTION);
@@ -246,7 +246,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         String qname = node.getQualifiedName();
         if (qname != null && !qname.equals(""))
         {
-            write(qname);
+            write(formatQualifiedName(qname));
             write(ASEmitterTokens.SPACE);
             writeToken(ASEmitterTokens.EQUAL);
             write(ASEmitterTokens.FUNCTION);
@@ -272,7 +272,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 
             getDoc().emitInterfaceMemberDoc((IFunctionNode) mnode, project);
             
-            write(qname);
+            write(formatQualifiedName(qname));
             write(ASEmitterTokens.MEMBER_ACCESS);
             write(JSEmitterTokens.PROTOTYPE);
             write(ASEmitterTokens.MEMBER_ACCESS);
@@ -322,7 +322,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         if (definition == null)
             definition = ndef.getContainingScope().getDefinition();
 
-        write(definition.getQualifiedName()
+        write(formatQualifiedName(definition.getQualifiedName())
                 + ASEmitterTokens.MEMBER_ACCESS.getToken() + root
                 + node.getName());
 
@@ -356,7 +356,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             writeNewline("/**");
             writeNewline("@expose");
             writeNewline(" */");
-            writeNewline(definition.getQualifiedName()
+            writeNewline(formatQualifiedName(definition.getQualifiedName())
                     + ASEmitterTokens.MEMBER_ACCESS.getToken() + root
                     + "get_" + node.getName()
                     + ASEmitterTokens.SPACE.getToken() + ASEmitterTokens.EQUAL.getToken()
@@ -371,7 +371,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             writeNewline("/**");
             writeNewline("@expose");
             writeNewline(" */");
-            writeNewline(definition.getQualifiedName()
+            writeNewline(formatQualifiedName(definition.getQualifiedName())
                     + ASEmitterTokens.MEMBER_ACCESS.getToken() + root
                     + "set_" + node.getName()
                     + ASEmitterTokens.SPACE.getToken() + ASEmitterTokens.EQUAL.getToken()
@@ -385,7 +385,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
                     + node.getName() + ASEmitterTokens.SEMICOLON.getToken());
             writeNewline("    " + ASEmitterTokens.THIS.getToken() + ASEmitterTokens.MEMBER_ACCESS.getToken()
                     + node.getName() + " = value;");
-            writeNewline("    this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(");
+            writeNewline("    this.dispatchEvent(org_apache_flex_events_ValueChangeEvent.createUpdateEvent(");
             writeNewline("         this, \"" + node.getName() + "\", oldValue, value));");
             writeNewline("}");
             write(ASEmitterTokens.BLOCK_CLOSE.getToken());
@@ -422,7 +422,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         String qname = getTypeDefinition(node).getQualifiedName();
         if (qname != null && !qname.equals(""))
         {
-            write(qname);
+            write(formatQualifiedName(qname));
             if (!isConstructor)
             {
                 write(ASEmitterTokens.MEMBER_ACCESS);
@@ -463,11 +463,11 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             writeNewline(ASEmitterTokens.SEMICOLON);
             write(JSGoogEmitterTokens.GOOG_INHERITS);
             write(ASEmitterTokens.PAREN_OPEN);
-            write(qname);
+            write(formatQualifiedName(qname));
             writeToken(ASEmitterTokens.COMMA);
             String sname = getSuperClassDefinition(node, project)
                     .getQualifiedName();
-            write(sname);
+            write(formatQualifiedName(sname));
             write(ASEmitterTokens.PAREN_CLOSE);
         }
     }
@@ -512,7 +512,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
                 def = node.resolveCalledExpression(project);
                 // all new calls to a class should be fully qualified names
                 if (def instanceof ClassDefinition)
-                    write(def.getQualifiedName());
+                    write(formatQualifiedName(def.getQualifiedName()));
                 else
                     // I think we still need this for "new someVarOfTypeClass"
                     getWalker().walk(node.getNameNode());
@@ -706,7 +706,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             String sname = nodeDef.getParent().getQualifiedName();
             if (sname.length() > 0)
             {
-                write(sname);
+                write(formatQualifiedName(sname));
                 write(ASEmitterTokens.MEMBER_ACCESS);
             }
         }
@@ -818,7 +818,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
                 if (cnode == null)
                     return;
                 
-                write(cnode.getQualifiedName());
+                write(formatQualifiedName(cnode.getQualifiedName()));
                 write(ASEmitterTokens.MEMBER_ACCESS);
                 write(JSGoogEmitterTokens.GOOG_BASE);
                 write(ASEmitterTokens.PAREN_OPEN);
@@ -851,7 +851,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         else if (emitName)
         {
             if (nodeDef != null)    
-                write(nodeDef.getQualifiedName());
+                write(formatQualifiedName(nodeDef.getQualifiedName()));
             else
                 write(node.getName());
         }
@@ -890,7 +890,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         if (cnode == null)
             return;
         
-        write(cnode.getQualifiedName());
+        write(formatQualifiedName(cnode.getQualifiedName()));
         write(ASEmitterTokens.MEMBER_ACCESS);
         write(JSGoogEmitterTokens.GOOG_BASE);
         write(ASEmitterTokens.PAREN_OPEN);
@@ -1059,7 +1059,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             
             IDefinition dnode = (node.getRightOperandNode()).resolve(project);
             if (dnode != null)
-                write(dnode.getQualifiedName());
+                write(formatQualifiedName(dnode.getQualifiedName()));
             else
                 getWalker().walk(node.getRightOperandNode());
         }
@@ -1181,7 +1181,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         writeToken(ASEmitterTokens.COMMA);
 
         if (dnode != null)
-            write(dnode.getQualifiedName());
+            write(formatQualifiedName(dnode.getQualifiedName()));
         else
             getWalker().walk(right);
         
@@ -1305,7 +1305,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 	        if (isBindableSetter)
 	        {
 	            getDoc().emitMethodDoc(fn, project);
-	            write(type.getQualifiedName());
+	            write(formatQualifiedName(type.getQualifiedName()));
 	            if (!node.hasModifier(ASModifier.STATIC))
 	            {
 	                write(ASEmitterTokens.MEMBER_ACCESS);
@@ -1358,7 +1358,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 	            writeNewline(ASEmitterTokens.SEMICOLON);
 	            
 	        	// add dispatch of change event
-	            writeNewline("    this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(");
+	            writeNewline("    this.dispatchEvent(org_apache_flex_events_ValueChangeEvent.createUpdateEvent(");
 	            writeNewline("         this, \"" + node.getName() + "\", oldValue, " + params[0].getName()
+ "));");
 	            write(ASEmitterTokens.BLOCK_CLOSE);
 	            writeNewline(ASEmitterTokens.SEMICOLON);
@@ -1371,7 +1371,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             project = getWalker().getProject();
 
         getDoc().emitMethodDoc(fn, project);
-        write(type.getQualifiedName());
+        write(formatQualifiedName(type.getQualifiedName()));
         if (!node.hasModifier(ASModifier.STATIC))
         {
             write(ASEmitterTokens.MEMBER_ACCESS);
@@ -1431,7 +1431,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         write(JSGoogEmitterTokens.GOOG_PROVIDE);
         write(ASEmitterTokens.PAREN_OPEN);
         write(ASEmitterTokens.SINGLE_QUOTE);
-        write(type.getQualifiedName());
+        write(formatQualifiedName(type.getQualifiedName()));
         write(ASEmitterTokens.SINGLE_QUOTE);
         write(ASEmitterTokens.PAREN_CLOSE);
         writeNewline(ASEmitterTokens.SEMICOLON);
@@ -1510,7 +1510,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
                     write(JSGoogEmitterTokens.GOOG_REQUIRE);
                     write(ASEmitterTokens.PAREN_OPEN);
                     write(ASEmitterTokens.SINGLE_QUOTE);
-                    write(imp);
+                    write(formatQualifiedName(imp));
                     write(ASEmitterTokens.SINGLE_QUOTE);
                     write(ASEmitterTokens.PAREN_CLOSE);
                     writeNewline(ASEmitterTokens.SEMICOLON);
@@ -1532,7 +1532,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 	                write(JSGoogEmitterTokens.GOOG_REQUIRE);
 	                write(ASEmitterTokens.PAREN_OPEN);
 	                write(ASEmitterTokens.SINGLE_QUOTE);
-	                write(imp);
+	                write(formatQualifiedName(imp));
 	                write(ASEmitterTokens.SINGLE_QUOTE);
 	                write(ASEmitterTokens.PAREN_CLOSE);
 	                writeNewline(ASEmitterTokens.SEMICOLON);
@@ -1594,7 +1594,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             getDoc().end();
 
             // a.B.prototype.AFJS_CLASS_INFO = {  };
-            write(type.getQualifiedName());
+            write(formatQualifiedName(type.getQualifiedName()));
             write(ASEmitterTokens.MEMBER_ACCESS);
             write(JSEmitterTokens.PROTOTYPE);
             write(ASEmitterTokens.MEMBER_ACCESS);
@@ -1616,7 +1616,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             write(JSFlexJSEmitterTokens.QNAME);
             writeToken(ASEmitterTokens.COLON);
             write(ASEmitterTokens.SINGLE_QUOTE);
-            write(tnode.getQualifiedName());
+            write(formatQualifiedName(tnode.getQualifiedName()));
             write(ASEmitterTokens.SINGLE_QUOTE);
             write(ASEmitterTokens.BLOCK_CLOSE);
             write(ASEmitterTokens.SQUARE_CLOSE);
@@ -1638,7 +1638,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
                 int i = 0;
                 for (IExpressionNode enode : enodes)
                 { 
-                    write(enode.resolve(project).getQualifiedName());
+                    write(formatQualifiedName(enode.resolve(project).getQualifiedName()));
                     if (i < enodes.length - 1)
                         writeToken(ASEmitterTokens.COMMA);
                     i++;
@@ -1895,4 +1895,11 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         super.emitUnaryOperator(node);
     }
     
+    private String formatQualifiedName(String name)
+    {
+    	if (name.contains("goog."))
+    		return name;
+    	name = name.replaceAll("\\.", "_");
+    	return name;
+    }
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/46a3d288/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java
index c30dcbc..ea99061 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java
@@ -29,7 +29,7 @@ public enum JSFlexJSEmitterTokens implements IEmitterTokens
     FLEXJS_CLASS_INFO("FLEXJS_CLASS_INFO"),
     INDENT("  "),
     INTERFACES("interfaces"),
-    LANGUAGE_QNAME("org.apache.flex.utils.Language"),
+    LANGUAGE_QNAME("org_apache_flex_utils_Language"),
     NAME("name"),
     NAMES("names"),
     QNAME("qName"),

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/46a3d288/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
index 8986fa4..0f8f960 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
@@ -74,7 +74,7 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
             IDefinition dnode = inode.resolve(project);
             if (dnode != null)
             {
-                emitJSDocLine(ASEmitterTokens.EXTENDS, dnode.getQualifiedName());
+                emitJSDocLine(ASEmitterTokens.EXTENDS, formatQualifiedName(dnode.getQualifiedName()));
             }
             else
             {
@@ -276,13 +276,13 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
     public void emitExtends(IClassDefinition superDefinition, String packageName)
     {
         emitJSDocLine(ASEmitterTokens.EXTENDS,
-                superDefinition.getQualifiedName());
+                formatQualifiedName(superDefinition.getQualifiedName()));
     }
 
     @Override
     public void emitImplements(ITypeDefinition definition, String packageName)
     {
-        emitJSDocLine(ASEmitterTokens.IMPLEMENTS, definition.getQualifiedName());
+        emitJSDocLine(ASEmitterTokens.IMPLEMENTS, formatQualifiedName(definition.getQualifiedName()));
     }
 
     @Override
@@ -508,4 +508,10 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
         
         return cnode.getDefinition();
     }
+    
+    protected String formatQualifiedName(String name)
+    {
+    	return name;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/46a3d288/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 cdee4d6..27bbd5e 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
@@ -319,9 +319,9 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         writeNewline();
         writeNewline("/**");
         writeNewline(" * @constructor");
-        writeNewline(" * @extends {" + baseClassName + "}");
+        writeNewline(" * @extends {" + formatQualifiedName(baseClassName) + "}");
         writeNewline(" */");
-        writeToken(cname);
+        writeToken(formatQualifiedName(cname));
         writeToken(ASEmitterTokens.EQUAL);
         write(ASEmitterTokens.FUNCTION);
         write(ASEmitterTokens.PAREN_OPEN);
@@ -329,7 +329,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         if (indent)
             indentPush();
         writeNewline(ASEmitterTokens.BLOCK_OPEN, true);
-        write(cname);
+        write(formatQualifiedName(cname));
         write(ASEmitterTokens.MEMBER_ACCESS);
         write(JSGoogEmitterTokens.GOOG_BASE);
         write(ASEmitterTokens.PAREN_OPEN);
@@ -405,9 +405,9 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         writeNewline(ASEmitterTokens.SEMICOLON);
         write(JSGoogEmitterTokens.GOOG_INHERITS);
         write(ASEmitterTokens.PAREN_OPEN);
-        write(cname);
+        write(formatQualifiedName(cname));
         writeToken(ASEmitterTokens.COMMA);
-        write(baseClassName);
+        write(formatQualifiedName(baseClassName));
         write(ASEmitterTokens.PAREN_CLOSE);
         writeNewline(ASEmitterTokens.SEMICOLON);
         writeNewline();
@@ -425,10 +425,10 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         writeNewline(" *");
         writeNewline(" * @type {Object.<string, Array.<Object>>}");
         writeNewline(" */");
-        write(cname + ".prototype.FLEXJS_CLASS_INFO = { names: [{ name: '");
+        write(formatQualifiedName(cname) + ".prototype.FLEXJS_CLASS_INFO = { names: [{ name:
'");
         write(cdef.getBaseName());
         write("', qName: '");
-        write(cname);
+        write(formatQualifiedName(cname));
         writeNewline("' }] };");
         writeNewline();
         writeNewline();
@@ -473,7 +473,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         writeNewline("/**");
         writeNewline(" * @expose");
         writeNewline(" */");
-        writeNewline(cname
+        writeNewline(formatQualifiedName(cname)
                 + ".prototype._bindings = [");
         
         Set<BindingInfo> bindingInfo = bindingDataBase.getBindingInfo();
@@ -815,9 +815,9 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         {
             writeNewline("/**");
             writeNewline(" * @expose");
-            writeNewline(" * @param {" + event.type + "} event");
+            writeNewline(" * @param {" + formatQualifiedName(event.type) + "} event");
             writeNewline(" */");
-            writeNewline(cname
+            writeNewline(formatQualifiedName(cname)
                     + ".prototype." + event.eventHandler + " = function(event)");
             writeNewline(ASEmitterTokens.BLOCK_OPEN, true);
 
@@ -844,7 +844,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
                 writeNewline(" * @expose");
                 writeNewline(" * @return {" + instance.name + "}");
                 writeNewline(" */");
-                writeNewline(cname
+                writeNewline(formatQualifiedName(cname)
                         + ".prototype.get_" + instance.id + " = function()");
                 indentPush();
                 writeNewline("{");
@@ -857,7 +857,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
                 writeNewline(" * @expose");
                 writeNewline(" * @param {" + instance.name + "} value");
                 writeNewline(" */");
-                writeNewline(cname
+                writeNewline(formatQualifiedName(cname)
                         + ".prototype.set_" + instance.id
                         + " = function(value)");
                 indentPush();
@@ -865,7 +865,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
                 indentPush();
                 writeNewline("if (value != this." + instance.id + ") {");
                 writeNewline("this." + instance.id + " = value;");
-                write("this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this,
'");
+                write("this.dispatchEvent(org_apache_flex_events_ValueChangeEvent.createUpdateEvent(this,
'");
                 indentPop();
                 writeNewline(instance.id + "', null, value));");
                 indentPop();
@@ -891,14 +891,14 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
             writeNewline(" * @override");
             writeNewline(" * @return {Array} the Array of UI element descriptors.");
             writeNewline(" */");
-            writeNewline(cname + ".prototype.get_MXMLDescriptor = function()");
+            writeNewline(formatQualifiedName(cname) + ".prototype.get_MXMLDescriptor = function()");
             indentPush();
             writeNewline("{");
             writeNewline("if (this.mxmldd == undefined)");
             indentPush();
             writeNewline("{");
             writeNewline("/** @type {Array} */");
-            writeNewline("var arr = " + cname + ".base(this, 'get_MXMLDescriptor');");
+            writeNewline("var arr = " + formatQualifiedName(cname) + ".base(this, 'get_MXMLDescriptor');");
             writeNewline("/** @type {Array} */");
             indentPop();
             indentPop();
@@ -1000,7 +1000,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         MXMLDescriptorSpecifier currentInstance = new MXMLDescriptorSpecifier();
         currentInstance.isProperty = false;
         currentInstance.id = id;
-        currentInstance.name = cdef.getQualifiedName();
+        currentInstance.name = formatQualifiedName(cdef.getQualifiedName());
         currentInstance.parent = currentPropertySpecifier;
 
         if (currentPropertySpecifier != null)
@@ -1143,7 +1143,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         
         MXMLDescriptorSpecifier setProp = new MXMLDescriptorSpecifier();
         setProp.isProperty = false;
-        setProp.name = nameToString(overrideName);
+        setProp.name = formatQualifiedName(nameToString(overrideName));
         setProp.parent = currentInstance;
         currentInstance.propertySpecifiers.add(setProp);
         
@@ -1228,7 +1228,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
 
         MXMLDescriptorSpecifier setEvent = new MXMLDescriptorSpecifier();
         setEvent.isProperty = false;
-        setEvent.name = nameToString(eventOverride);
+        setEvent.name = formatQualifiedName(nameToString(eventOverride));
         setEvent.parent = currentInstance;
         currentInstance.propertySpecifiers.add(setEvent);
         // Set its 'target' property to the id of the object
@@ -1297,7 +1297,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
 
         MXMLDescriptorSpecifier addItems = new MXMLDescriptorSpecifier();
         addItems.isProperty = false;
-        addItems.name = nameToString(instanceOverrideName);
+        addItems.name = formatQualifiedName(nameToString(instanceOverrideName));
         addItems.parent = currentInstance;
         currentInstance.propertySpecifiers.add(addItems);
         MXMLDescriptorSpecifier itemsDescIndex = new MXMLDescriptorSpecifier();
@@ -1688,12 +1688,12 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
     public void emitFactory(IMXMLFactoryNode node)
     {
         MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
-        ps.value = "new mx.core.ClassFactory(";
+        ps.value = formatQualifiedName("new mx.core.ClassFactory(");
 
         IASNode cnode = node.getChild(0);
         if (cnode instanceof IMXMLClassNode)
         {
-            ps.value += ((IMXMLClassNode)cnode).getValue(getMXMLWalker().getProject()).getQualifiedName();
+            ps.value += formatQualifiedName(((IMXMLClassNode)cnode).getValue(getMXMLWalker().getProject()).getQualifiedName());
         }
         ps.value += ")";
     }
@@ -1704,7 +1704,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
     public void emitComponent(IMXMLComponentNode node)
     {
         MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
-        ps.value = "new mx.core.ClassFactory(";
+        ps.value = formatQualifiedName("new mx.core.ClassFactory(");
 
         ps.value += node.getName();
         ps.value += ")";
@@ -1827,7 +1827,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
                 : JSGoogEmitterTokens.GOOG_REQUIRE);
         write(ASEmitterTokens.PAREN_OPEN);
         write(ASEmitterTokens.SINGLE_QUOTE);
-        write(qname);
+        write(formatQualifiedName(qname));
         write(ASEmitterTokens.SINGLE_QUOTE);
         write(ASEmitterTokens.PAREN_CLOSE);
         writeNewline(ASEmitterTokens.SEMICOLON);
@@ -1907,4 +1907,12 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         }
     }
 
+    private String formatQualifiedName(String name)
+    {
+    	if (name.contains("goog."))
+    		return name;
+    	name = name.replaceAll("\\.", "_");
+    	return name;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/46a3d288/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
b/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
index 76fda8c..1033c53 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
@@ -58,7 +58,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession
         sb.append("];\n");
         for (String r : requires)
         {
-            sb.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken() + "('" + r + "');\n");
+            sb.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken() + "('" + formatQualifiedName(r)
+ "');\n");
         }
 
         return sb.toString();        
@@ -212,6 +212,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession
                 result.append("\"" + sel.toString() + "\"");
             else
             {
+            	selName = formatQualifiedName(selName);
                 ImmutableList<ICSSSelectorCondition> conds = sel.getConditions();
                 for (ICSSSelectorCondition cond : conds)
                     selName += cond.toString();
@@ -314,7 +315,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession
                     }
                     else
                     {
-                        result.append(className);
+                        result.append(formatQualifiedName(className));
                         requires.add(className);
                     }
                 }
@@ -364,4 +365,16 @@ public class JSCSSCompilationSession extends CSSCompilationSession
         return false;
     }
 
+    private String formatQualifiedName(String name)
+    {
+    	if (name.contains("goog."))
+    		return name;
+    	if (name.startsWith("."))
+    	{
+    		return "." + name.substring(1).replaceAll("\\.", "_");
+    	}
+    	name = name.replaceAll("\\.", "_");
+    	return name;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/46a3d288/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java b/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
index 37acf0c..53a216e 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
@@ -244,7 +244,7 @@ public class GoogDepsWriter {
 	    File destFile;
 	    File f;
 	    
-		String classPath = className.replace(".", File.separator);
+		String classPath = className.replace("_", File.separator);
 		
         fn = outputFolderPath + File.separator + classPath + ".js";
         f = new File(fn);
@@ -266,12 +266,12 @@ public class GoogDepsWriter {
     				FileUtils.copyFile(f, destFile);
     				
     				// (erikdebruin) copy class assets files
-    				if (className.contains("org.apache.flex"))
+    				if (className.contains("org_apache_flex"))
     				{
     				    File assetsDir = new File(f.getParentFile(), "assets");
     				    if (assetsDir.exists())
     				    {
-    				        String nameOfClass = className.substring(className.lastIndexOf('.') + 1);
+    				        String nameOfClass = className.substring(className.lastIndexOf('_') + 1);
     				        
     				        File[] assetsList = assetsDir.listFiles();
 					        assert assetsList != null;
@@ -280,8 +280,8 @@ public class GoogDepsWriter {
 
 						        if (assetFile.isFile() && assetFileName.indexOf(nameOfClass) == 0)
{
 							        String pathOfClass;
-							        pathOfClass = className.substring(0, className.lastIndexOf('.'));
-							        pathOfClass = pathOfClass.replace(".", File.separator);
+							        pathOfClass = className.substring(0, className.lastIndexOf('_'));
+							        pathOfClass = pathOfClass.replace("_", File.separator);
 
 							        destFile = new File(outputFolderPath +
 									        File.separator + pathOfClass +


Mime
View raw message