flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mschma...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - Added @see tag for Class field js types.
Date Thu, 11 Jun 2015 23:10:15 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 59b80b18c -> ec1bbb44b


Added @see tag for Class field js types.


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

Branch: refs/heads/develop
Commit: ec1bbb44b5fc1a4b926308d4fae5008a2162214b
Parents: 59b80b1
Author: Michael Schmalle <mschmalle@apache.org>
Authored: Thu Jun 11 19:09:45 2015 -0400
Committer: Michael Schmalle <mschmalle@apache.org>
Committed: Thu Jun 11 19:09:45 2015 -0400

----------------------------------------------------------------------
 .../externals/reference/BaseReference.java      |  1 -
 .../externals/reference/FieldReference.java     | 42 +++++++++++++++-----
 2 files changed, 31 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ec1bbb44/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java
index 7c9de3a..0588bc9 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java
@@ -245,7 +245,6 @@ public abstract class BaseReference
                     sb.append(description);
                 sb.append("\n");
             }
-
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ec1bbb44/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java
index d14df69..5a77e7b 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java
@@ -24,6 +24,7 @@ import org.apache.flex.compiler.internal.codegen.externals.utils.FunctionUtils;
 import org.apache.flex.compiler.internal.codegen.externals.utils.JSTypeUtils;
 
 import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.JSTypeExpression;
 import com.google.javascript.rhino.Node;
 
 public class FieldReference extends MemberReference
@@ -41,8 +42,7 @@ public class FieldReference extends MemberReference
         this.isStatic = isStatic;
     }
 
-    public FieldReference(ReferenceModel model, ClassReference classReference,
-            Node node, String name, JSDocInfo comment, boolean isStatic)
+    public FieldReference(ReferenceModel model, ClassReference classReference, Node node,
String name, JSDocInfo comment, boolean isStatic)
     {
         super(model, classReference, node, name, comment);
         this.isStatic = isStatic;
@@ -84,11 +84,8 @@ public class FieldReference extends MemberReference
 
         String isPublic = getClassReference().isInterface() ? "" : "public ";
 
-        sb.append("    " + isPublic + staticValue + "function get "
-                + getQualifiedName() + "():" + toReturnString() + ";\n");
-        sb.append("    " + isPublic + staticValue + "function set "
-                + getQualifiedName() + "(" + toPrameterString() + "):void"
-                + ";\n");
+        sb.append("    " + isPublic + staticValue + "function get " + getQualifiedName()
+ "():" + toReturnString() + ";\n");
+        sb.append("    " + isPublic + staticValue + "function set " + getQualifiedName()
+ "(" + toPrameterString() + "):void" + ";\n");
     }
 
     private void printVar(StringBuilder sb)
@@ -99,8 +96,7 @@ public class FieldReference extends MemberReference
         if (type.indexOf("|") != -1 || type.indexOf("?") != -1)
             type = "*";
 
-        sb.append("    public " + staticValue + "var " + getQualifiedName()
-                + ":" + type + ";\n");
+        sb.append("    public " + staticValue + "var " + getQualifiedName() + ":" + type
+ ";\n");
     }
 
     private String toTypeString()
@@ -115,8 +111,32 @@ public class FieldReference extends MemberReference
 
     private String toPrameterString()
     {
-        return FunctionUtils.toParameter(this, getComment(), "value",
-                getComment().getType());
+        return FunctionUtils.toParameter(this, getComment(), "value", getComment().getType());
     }
 
+    @Override
+    protected void emitCommentBody(StringBuilder sb)
+    {
+        emitBlockDescription(sb);
+        emitType(sb);
+        emitSee(sb);
+        emitSeeSourceFileName(sb);
+    }
+
+    private void emitType(StringBuilder sb)
+    {
+        JSTypeExpression type = getComment().getType();
+        if (type != null)
+        {
+            sb.append("     * @see JSType - ");
+            sb.append("[");
+            sb.append(type.evaluate(null, getModel().getCompiler().getTypeRegistry()).toAnnotationString());
+            sb.append("] ");
+            String description = getComment().getReturnDescription();
+            if (description != null)
+                sb.append(description);
+            sb.append("\n");
+        }
+
+    }
 }


Mime
View raw message