flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [2/2] git commit: [flex-falcon] - Find a way to not goog.require interfaces
Date Thu, 18 Apr 2013 17:23:02 GMT
Find a way to not goog.require interfaces


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

Branch: refs/heads/develop
Commit: f586152e50d39e24bdc5cc594749471535c70dad
Parents: 2a12b88
Author: Alex Harui <aharui@apache.org>
Authored: Thu Apr 18 09:11:01 2013 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Apr 18 09:12:42 2013 -0700

----------------------------------------------------------------------
 .../compiler/internal/projects/FlexJSProject.java  |   61 +++++++++-----
 .../compiler/internal/scopes/ASProjectScope.java   |    2 +-
 2 files changed, 40 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f586152e/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
index dd3467a..7cd5539 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
@@ -20,9 +20,15 @@ package org.apache.flex.compiler.internal.projects;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 
 import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
+import org.apache.flex.compiler.internal.scopes.ASProjectScope.DefinitionPromise;
 import org.apache.flex.compiler.internal.workspaces.Workspace;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
 import org.apache.flex.compiler.units.ICompilationUnit;
 
 /**
@@ -48,28 +54,39 @@ public class FlexJSProject extends FlexProject
     @Override
     public void addDependency(ICompilationUnit from, ICompilationUnit to, DependencyType
dt, String qname)
     {
-    	ArrayList<String> reqs;
-    	if (requires.containsKey(from))
-    		reqs = requires.get(from);
-    	else
-    	{
-    		reqs = new ArrayList<String>();
-    		requires.put(from, reqs);
-    	}
-    	// if the class is already required by some other class
-    	// don't add it.  Otherwise we can get circular
-    	// dependencies.
-    	boolean circular = (from == to);
-    	if (requires.containsKey(to))
-    	{
-    		if (alreadyRequired.containsKey(qname))
-    			circular = true;
-    	}
-    	if (!circular || dt == DependencyType.INHERITANCE)
-    	{
-    		reqs.add(qname);
-    		alreadyRequired.put(qname, from);
-    	}
+        IDefinition def = to.getDefinitionPromises().get(0);
+        IDefinition actualDef = ((DefinitionPromise) def).getActualDefinition();
+        boolean isInterface = actualDef instanceof InterfaceDefinition;
+        if (isInterface)
+        {
+            System.out.println("Interface: " + qname);
+        }
+        else
+        {
+            
+        	ArrayList<String> reqs;
+        	if (requires.containsKey(from))
+        		reqs = requires.get(from);
+        	else
+        	{
+        		reqs = new ArrayList<String>();
+        		requires.put(from, reqs);
+        	}
+        	// if the class is already required by some other class
+        	// don't add it.  Otherwise we can get circular
+        	// dependencies.
+        	boolean circular = (from == to);
+        	if (requires.containsKey(to))
+        	{
+        		if (alreadyRequired.containsKey(qname))
+        			circular = true;
+        	}
+        	if (!circular || dt == DependencyType.INHERITANCE)
+        	{
+        		reqs.add(qname);
+        		alreadyRequired.put(qname, from);
+        	}
+        }
         super.addDependency(from, to, dt, qname);
     }
     

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f586152e/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java b/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java
index 9c871ad..5c61521 100644
--- a/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java
+++ b/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java
@@ -2034,7 +2034,7 @@ public class ASProjectScope extends ASScopeBase
         // TODO Consider eliminating this field.
         private IDefinition actualDefinition;
 
-        private IDefinition getActualDefinition()
+        public IDefinition getActualDefinition()
         {
             if (actualDefinition != null)
                 return actualDefinition;


Mime
View raw message