You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/11/19 23:28:43 UTC

[1/3] git commit: [flex-falcon] [refs/heads/develop] - FLEX-33917 emit interface types fully qualified when used as an argument in a function call

Updated Branches:
  refs/heads/develop 6d8761404 -> fc4b7cfe3


FLEX-33917 emit interface types fully qualified when used as an argument in a function call

Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: eb288784de126177d9ed1515de3308ccf2fa3d53
Parents: 6d87614
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Tue Nov 19 23:25:33 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Tue Nov 19 23:25:33 2013 +0100

----------------------------------------------------------------------
 .../compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/eb288784/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 6802ba5..eda5579 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
@@ -604,8 +604,10 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         boolean emitName = true;
 
         if (nodeDef != null
-                && (nodeDef.isStatic() || (nodeDef instanceof ClassDefinition && nodeDef
-                        .getParent() != null)))
+                && (nodeDef.isStatic() || (
+                        (nodeDef instanceof ClassDefinition || 
+                                nodeDef instanceof InterfaceDefinition) && 
+                        nodeDef.getParent() != null)))
         {
             String sname = nodeDef.getParent().getQualifiedName();
             if (sname.length() > 0)


[3/3] git commit: [flex-falcon] [refs/heads/develop] - Emit fully qualified interface type as return type in function JSDoc

Posted by er...@apache.org.
Emit fully qualified interface type as return type in function JSDoc

Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: fc4b7cfe340c99aaf4e03db7025bc5fe503c56fb
Parents: 81121b9
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Tue Nov 19 23:27:59 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Tue Nov 19 23:27:59 2013 +0100

----------------------------------------------------------------------
 .../internal/codegen/js/flexjs/JSFlexJSDocEmitter.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fc4b7cfe/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 b5e78f7..adb3b60 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
@@ -25,11 +25,13 @@ import org.apache.flex.compiler.common.DependencyType;
 import org.apache.flex.compiler.constants.IASKeywordConstants;
 import org.apache.flex.compiler.constants.IASLanguageConstants;
 import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
 import org.apache.flex.compiler.definitions.ITypeDefinition;
 import org.apache.flex.compiler.definitions.references.IReference;
 import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
 import org.apache.flex.compiler.internal.scopes.ASScope;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.tree.as.IExpressionNode;
@@ -120,7 +122,16 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
                         hasDoc = true;
                     }
 
-                    emitReturn(node, node.getPackageName());
+                    ITypeDefinition tdef = ((IFunctionDefinition)node.getDefinition())
+                            .resolveReturnType(project);
+
+                    String packageName = "";
+                    if (tdef instanceof InterfaceDefinition)
+                        packageName = tdef.getPackageName();
+                    else
+                        packageName = node.getPackageName();
+                    
+                    emitReturn(node, packageName);
                 }
 
                 // @override


[2/3] git commit: [flex-falcon] [refs/heads/develop] - Added new interface type as function call argument use case; added interface type as return type use case

Posted by er...@apache.org.
Added new interface type as function call argument use case; added interface type as return type use case

Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: 81121b958bf01b4ea8f082b4702fa732457b63a8
Parents: eb28878
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Tue Nov 19 23:27:15 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Tue Nov 19 23:27:15 2013 +0100

----------------------------------------------------------------------
 .../test-files/flexjs/projects/interfaces/Test.as       |  8 ++++++++
 .../flexjs/projects/interfaces/Test_result.js           | 12 ++++++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/81121b95/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test.as b/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test.as
index 4715e4c..6f251c9 100644
--- a/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test.as
+++ b/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test.as
@@ -2,6 +2,7 @@ package
 {
 	import classes.A;
 	import interfaces.IA;
+	import interfaces.IC;
 	import interfaces.IE;
 
   public class Test extends A implements IA, IE
@@ -9,6 +10,13 @@ package
     public function Test()
     {
       super();
+      
+      var ia:IA = doSomething(IC) as IA
+    }
+    
+    public function doSomething(ic:IC):IC
+    {
+      return ic;
     }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/81121b95/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js b/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js
index 189c30a..838e617 100644
--- a/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js
+++ b/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js
@@ -10,6 +10,7 @@ goog.provide('Test');
 
 goog.require('classes.A');
 goog.require('interfaces.IA');
+goog.require('interfaces.IC');
 goog.require('interfaces.IE');
 goog.require('org.apache.flex.utils.Language');
 
@@ -23,11 +24,22 @@ goog.require('org.apache.flex.utils.Language');
  */
 Test = function() {
   goog.base(this);
+  var /** @type {interfaces.IA} */ ia = org.apache.flex.utils.Language.as(this.doSomething(interfaces.IC), interfaces.IA);
 };
 goog.inherits(Test, classes.A);
 
 
 /**
+ * @expose
+ * @param {interfaces.IC} ic
+ * @return {interfaces.IC}
+ */
+Test.prototype.doSomething = function(ic) {
+  return ic;
+};
+
+
+/**
  * Metadata
  *
  * @type {Object.<string, Array.<Object>>}