flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - more fixes to JSON asdoc
Date Fri, 09 Dec 2016 14:51:21 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 3cb605a9a -> 9f65a8072


more fixes to JSON asdoc


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

Branch: refs/heads/develop
Commit: 9f65a80728e918108f498267bbc7f50bc365f201
Parents: 3cb605a
Author: Alex Harui <aharui@apache.org>
Authored: Fri Dec 9 06:51:03 2016 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Dec 9 06:51:03 2016 -0800

----------------------------------------------------------------------
 .../codegen/js/flexjs/JSFlexJSASDocEmitter.java | 27 ++++++++++++++------
 1 file changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9f65a807/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSASDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSASDocEmitter.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSASDocEmitter.java
index 3ca83a4..09567f4 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSASDocEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSASDocEmitter.java
@@ -57,6 +57,7 @@ import org.apache.flex.compiler.tree.as.IASNode;
 import org.apache.flex.compiler.tree.as.IAccessorNode;
 import org.apache.flex.compiler.tree.as.IClassNode;
 import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
 import org.apache.flex.compiler.tree.as.IFileNode;
 import org.apache.flex.compiler.tree.as.IFunctionNode;
 import org.apache.flex.compiler.tree.as.IGetterNode;
@@ -238,7 +239,14 @@ public class JSFlexJSASDocEmitter extends JSGoogEmitter implements IJSFlexJSEmit
         writeNewline("\",");
         indentPush();
         write("  \"baseClassname\": \"");
-        write(formatQualifiedName(node.getBaseClassName()));
+        IExpressionNode baseNode = node.getBaseClassExpressionNode();
+        if (baseNode != null)
+        {
+            IDefinition baseDef = baseNode.resolve(getWalker().getProject());
+        	write(formatQualifiedName(baseDef.getQualifiedName()));
+        }
+        else
+        	write(formatQualifiedName(node.getBaseClassName()));
         writeNewline("\"");
         if (asDoc != null)
         {
@@ -305,19 +313,21 @@ public class JSFlexJSASDocEmitter extends JSGoogEmitter implements IJSFlexJSEmit
         write("  \"qname\": \"");
         write(formatQualifiedName(node.getQualifiedName()));
         writeNewline("\",");
-        String bases[] = node.getExtendedInterfaces();
+        IExpressionNode bases[] = node.getExtendedInterfaceNodes();
+        String baseNames[] = node.getExtendedInterfaces();
         if (bases.length > 0)
         {
         	writeNewline(",");
-        	writeNewline("extends: [");
+        	writeNewline("\"baseInterfaceNames\": [");
             boolean firstBase = true;
-	        for (String base : bases)
+            int n = bases.length;
+	        for (int i = 0; i < n; i++)
 	        {
 	        	if (!firstBase)
 	        		writeNewline(", ");
 	        	firstBase = false;
-	        	write("\"" + base + "\"");
-	        	write(base);
+	        	IDefinition baseDef = bases[i].resolve(getWalker().getProject());
+	        	write("\"" + formatQualifiedName(baseDef.getQualifiedName()) + "\"");
 	        }
         	writeNewline("]");
         }
@@ -581,15 +591,16 @@ public class JSFlexJSASDocEmitter extends JSGoogEmitter implements IJSFlexJSEmit
     	{
     		if (!firstParam)
     			writeNewline(",");
+    		firstParam = false;
     		write("{ \"name\": \"");
     		write(param.getBaseName());
     		write("\", \"type\": \"");
             write(formatQualifiedName(param.getTypeAsDisplayString()));
-            writeNewline("\"}");    		
+            write("\"}");    		
     	}
     	write("]");
         indentPop();
-        write("}");
+        writeNewline("}");
         addToIndex(node.getDefinition(), asDoc);
     }
     


Mime
View raw message