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] - inject [ArrayElementType] metadata when IArrayLike is found. Might allow us to allow type-checking of [i] array access
Date Fri, 30 Sep 2016 15:08:45 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 05672812b -> c11b36f27


inject [ArrayElementType] metadata when IArrayLike is found.  Might allow us to allow type-checking
of [i] array access


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

Branch: refs/heads/develop
Commit: 7a44e380f67a0f16bfba0db44c1fb152e2541f47
Parents: 0567281
Author: Alex Harui <aharui@apache.org>
Authored: Wed Sep 28 07:51:40 2016 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Sep 29 20:56:43 2016 -0700

----------------------------------------------------------------------
 .../externals/reference/ClassReference.java     | 31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7a44e380/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
index 6e4e9fb..469a5df 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
@@ -768,11 +768,42 @@ public class ClassReference extends BaseReference
             sb.append(" * @constructor\n");
         if (getComment().hasBaseType())
         {
+        	sb.append(" * @");
             emitSuperClass(sb);
+            sb.append("\n");
         }
         if (!isInterface())
         {
+        	sb.append(" * @");
             emitImplements(sb);
+            sb.append("\n");
+            List<JSTypeExpression> implementedInterfaces = getComment().getImplementedInterfaces();
+            int len = implementedInterfaces.size();
+            if (len != 0)
+            {
+                for (int i = 0; i < len; i++)
+                {
+                    String value = getModel().evaluate(implementedInterfaces.get(i)).getDisplayName();
+
+                    if (value.equals("IArrayLike"))
+                    {
+                    	String comment = getComment().getOriginalCommentString();
+                    	int c = comment.indexOf("IArrayLike");
+                    	int c1 = comment.indexOf('<', c);
+                    	if (c1 == c + 10)
+                    	{
+                    		int c2 =  comment.indexOf('>', c1);
+                    		if (c2 != -1)
+                    		{
+                    			String type = comment.substring(c1 + 1, c2);
+                    			int insert = sb.toString().indexOf("\n");
+                    			sb.insert(insert + 1, "\n[ArrayElementType(\"" + JSTypeUtils.transformType(type)
+ "\")]\n");
+                    		}
+                    	}
+                    	break;
+                    }
+                }           	
+            }
         }
     }
 


Mime
View raw message