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/12/06 11:37:11 UTC

[1/9] git commit: [flex-falcon] [refs/heads/develop] - Fixing test to match the new !Class but Object type annotation.

Updated Branches:
  refs/heads/develop 70683e5d2 -> f95e2d231


Fixing test to match the new !Class but Object type annotation.

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/15035e6e
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/15035e6e
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/15035e6e

Branch: refs/heads/develop
Commit: 15035e6e2390cde788d8046268ea1175eeb29463
Parents: 70683e5
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 08:28:15 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 08:28:15 2013 +0100

----------------------------------------------------------------------
 .../compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/15035e6e/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java
index 412283d..1bbdf55 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java
@@ -73,7 +73,7 @@ public class TestGoogGlobalClasses extends TestGlobalClasses
     {
         IVariableNode node = getVariable("var a:Class = new Class();");
         asBlockWalker.visitVariable(node);
-        assertOut("var /** @type {Class} */ a = new Class()");
+        assertOut("var /** @type {Object} */ a = new Class()");
     }
 
     @Override


[4/9] git commit: [flex-falcon] [refs/heads/develop] - Raise property visibility to allow for method override.

Posted by er...@apache.org.
Raise property visibility to allow for method override.

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/c5e6f211
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/c5e6f211
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/c5e6f211

Branch: refs/heads/develop
Commit: c5e6f211d51514a946c90126268a1214bf707c4f
Parents: 53eb561
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 10:14:09 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 10:14:09 2013 +0100

----------------------------------------------------------------------
 .../flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c5e6f211/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java
index 3bebc64..65c591c 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java
@@ -85,7 +85,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
     protected static final String CONSTRUCTOR_FULL = "fullConstructor";
     protected static final String SUPER_FUNCTION_CALL = "replaceSuperFunction";
 
-    private List<String> propertyNames = new ArrayList<String>();
+    protected List<String> propertyNames = new ArrayList<String>();
 
     protected ICompilerProject project;
 


[9/9] git commit: [flex-falcon] [refs/heads/develop] - Fixes issue where the namespace of the package instead of the namespace of the type is prefixed in the JSDoc annotation of an interface member.

Posted by er...@apache.org.
Fixes issue where the namespace of the package instead of the namespace of the type is prefixed in the JSDoc annotation of an interface member.

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/f95e2d23
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/f95e2d23
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/f95e2d23

Branch: refs/heads/develop
Commit: f95e2d231ae60359dc386a001b91daa86090ce6d
Parents: 5835285
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 11:33:17 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 11:33:17 2013 +0100

----------------------------------------------------------------------
 .../internal/codegen/js/flexjs/JSFlexJSDocEmitter.java       | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f95e2d23/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 ab75379..235deb1 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
@@ -169,13 +169,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
             ITypeDefinition tdef = ((IFunctionDefinition)node.getDefinition())
                     .resolveReturnType(project);
 
-            String packageName = "";
-            if (tdef instanceof InterfaceDefinition)
-                packageName = tdef.getPackageName();
-            else
-                packageName = node.getPackageName();
-            
-            emitReturn((IFunctionNode) node, packageName);
+            emitReturn((IFunctionNode) node, tdef.getPackageName());
         }
 
         IParameterNode[] parameters = ((IFunctionNode) node).getParameterNodes();


[5/9] git commit: [flex-falcon] [refs/heads/develop] - Changed the tests for the proper emission of parameters of the interface members.

Posted by er...@apache.org.
Changed the tests for the proper emission of parameters of the interface members.

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/aa156294
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/aa156294
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/aa156294

Branch: refs/heads/develop
Commit: aa1562940146cda281198531db7d02ba2c4f691a
Parents: c5e6f21
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 10:55:46 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 10:55:46 2013 +0100

----------------------------------------------------------------------
 .../compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java | 4 ++--
 .../flexjs/projects/interfaces/interfaces/IE_result.js           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/aa156294/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
index d95eef1..eff48c5 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
@@ -43,7 +43,7 @@ public class TestFlexJSInterface extends TestGoogInterface
                 + "function get foo1():Object;"
                 + "function set foo1(value:Object):void;}");
         asBlockWalker.visitInterface(node);
-        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.get_foo1 = function() {};\n\n\nIA.prototype.set_foo1 = function() {};");
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.get_foo1 = function() {};\n\n\nIA.prototype.set_foo1 = function(value) {};");
     }
 
     @Override
@@ -67,7 +67,7 @@ public class TestFlexJSInterface extends TestGoogInterface
                 + "function baz1():Object;"
                 + "function baz2(value:Object):void;}");
         asBlockWalker.visitInterface(node);
-        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.get_foo1 = function() {};\n\n\nIA.prototype.set_foo1 = function() {};\n\n\nIA.prototype.baz1 = function() {};\n\n\nIA.prototype.baz2 = function(value) {};");
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.get_foo1 = function() {};\n\n\nIA.prototype.set_foo1 = function(value) {};\n\n\nIA.prototype.baz1 = function() {};\n\n\nIA.prototype.baz2 = function(value) {};");
     }
 
     protected IBackend createBackend()

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/aa156294/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js b/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
index d3f50b1..d1443d7 100644
--- a/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
+++ b/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
@@ -23,7 +23,7 @@ interfaces.IE.prototype.myMethod = function() {};
 interfaces.IE.prototype.get_myProp = function() {};
 
 
-interfaces.IE.prototype.set_myProp = function() {};
+interfaces.IE.prototype.set_myProp = function(value) {};
 
 
 /**


[3/9] git commit: [flex-falcon] [refs/heads/develop] - New interface member emission.

Posted by er...@apache.org.
New interface member emission.

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/53eb5618
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/53eb5618
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/53eb5618

Branch: refs/heads/develop
Commit: 53eb5618a240c4724b7879d2b07c87d278b9a9a7
Parents: e3eff8e
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 10:12:54 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 10:12:54 2013 +0100

----------------------------------------------------------------------
 .../codegen/js/flexjs/JSFlexJSEmitter.java      | 55 ++++++++++++--------
 1 file changed, 33 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/53eb5618/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 cd67c00..712e8c5 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
@@ -220,7 +220,6 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         }
 
         
-        /* (aharui): is there any reason to emit members at all?
         final IDefinitionNode[] members = node.getAllMemberDefinitionNodes();
         for (IDefinitionNode mnode : members)
         {
@@ -229,38 +228,50 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 
             if (!isAccessor || !propertyNames.contains(qname))
             {
-                writeNewline();
-
-                write(qname);
-                write(ASEmitterTokens.MEMBER_ACCESS);
-                write(JSEmitterTokens.PROTOTYPE);
-                write(ASEmitterTokens.MEMBER_ACCESS);
-                write(mnode.getQualifiedName());
-
                 if (isAccessor && !propertyNames.contains(qname))
                 {
                     propertyNames.add(qname);
                 }
+
+                if (isAccessor)
+                {
+                    emitInterfaceMember(qname, mnode, true, true);
+                    emitInterfaceMember(qname, mnode, true, false);
+                }
                 else
                 {
-                    write(ASEmitterTokens.SPACE);
-                    writeToken(ASEmitterTokens.EQUAL);
-                    write(ASEmitterTokens.FUNCTION);
-
-                    emitParameters(((IFunctionNode) mnode).getParameterNodes());
-
-                    write(ASEmitterTokens.SPACE);
-                    write(ASEmitterTokens.BLOCK_OPEN);
-                    writeNewline();
-                    write(ASEmitterTokens.BLOCK_CLOSE);
+                    emitInterfaceMember(qname, mnode, false, false);
                 }
-
-                write(ASEmitterTokens.SEMICOLON);
             }
         }
-        */
     }
 
+    private void emitInterfaceMember(String qname, IDefinitionNode dnode, 
+            boolean isAccessor, boolean isGetter)
+    {
+        writeNewline();
+        writeNewline();
+        writeNewline();
+
+        write(qname);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSEmitterTokens.PROTOTYPE);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        if (isAccessor)
+        {
+            writeGetSetPrefix(isGetter);
+        }
+        write(dnode.getQualifiedName());
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+        emitParameters(((IFunctionNode) dnode).getParameterNodes());
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.BLOCK_OPEN);
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        write(ASEmitterTokens.SEMICOLON);
+    }
+    
     @Override
     public void emitField(IVariableNode node)
     {


[6/9] git commit: [flex-falcon] [refs/heads/develop] - Proper emission of parameters of interface members.

Posted by er...@apache.org.
Proper emission of parameters of interface members.

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/dfa58928
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/dfa58928
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/dfa58928

Branch: refs/heads/develop
Commit: dfa58928feafa07090dc51a6ec059f0824d195b7
Parents: aa15629
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 10:56:46 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 10:56:46 2013 +0100

----------------------------------------------------------------------
 .../codegen/js/flexjs/JSFlexJSEmitter.java      | 60 +++++++-------------
 1 file changed, 19 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dfa58928/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 712e8c5..947a268 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
@@ -226,52 +226,30 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             boolean isAccessor = mnode.getNodeID() == ASTNodeID.GetterID
                     || mnode.getNodeID() == ASTNodeID.SetterID;
 
-            if (!isAccessor || !propertyNames.contains(qname))
-            {
-                if (isAccessor && !propertyNames.contains(qname))
-                {
-                    propertyNames.add(qname);
-                }
+            writeNewline();
+            writeNewline();
+            writeNewline();
 
-                if (isAccessor)
-                {
-                    emitInterfaceMember(qname, mnode, true, true);
-                    emitInterfaceMember(qname, mnode, true, false);
-                }
-                else
-                {
-                    emitInterfaceMember(qname, mnode, false, false);
-                }
+            write(qname);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            if (isAccessor)
+            {
+                writeGetSetPrefix(mnode.getNodeID() == ASTNodeID.GetterID);
             }
+            write(mnode.getQualifiedName());
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.FUNCTION);
+            emitParameters(((IFunctionNode) mnode).getParameterNodes());
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
         }
     }
 
-    private void emitInterfaceMember(String qname, IDefinitionNode dnode, 
-            boolean isAccessor, boolean isGetter)
-    {
-        writeNewline();
-        writeNewline();
-        writeNewline();
-
-        write(qname);
-        write(ASEmitterTokens.MEMBER_ACCESS);
-        write(JSEmitterTokens.PROTOTYPE);
-        write(ASEmitterTokens.MEMBER_ACCESS);
-        if (isAccessor)
-        {
-            writeGetSetPrefix(isGetter);
-        }
-        write(dnode.getQualifiedName());
-        write(ASEmitterTokens.SPACE);
-        writeToken(ASEmitterTokens.EQUAL);
-        write(ASEmitterTokens.FUNCTION);
-        emitParameters(((IFunctionNode) dnode).getParameterNodes());
-        write(ASEmitterTokens.SPACE);
-        write(ASEmitterTokens.BLOCK_OPEN);
-        write(ASEmitterTokens.BLOCK_CLOSE);
-        write(ASEmitterTokens.SEMICOLON);
-    }
-    
     @Override
     public void emitField(IVariableNode node)
     {


[8/9] git commit: [flex-falcon] [refs/heads/develop] - Changed the tests for the proper emission of JSDoc annotations for the interface members.

Posted by er...@apache.org.
Changed the tests for the proper emission of JSDoc annotations for the interface members.

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/58352859
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/58352859
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/58352859

Branch: refs/heads/develop
Commit: 583528598d3079c5d7e1242b119db6c9d8f43f7d
Parents: 17ccd49
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 11:19:37 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 11:19:37 2013 +0100

----------------------------------------------------------------------
 .../internal/codegen/js/flexjs/TestFlexJSInterface.java        | 6 +++---
 .../compiler/internal/codegen/js/goog/TestGoogProject.java     | 2 ++
 .../flexjs/projects/interfaces/interfaces/IE_result.js         | 6 ++++++
 3 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/58352859/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
index eff48c5..1bc10f4 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
@@ -43,7 +43,7 @@ public class TestFlexJSInterface extends TestGoogInterface
                 + "function get foo1():Object;"
                 + "function set foo1(value:Object):void;}");
         asBlockWalker.visitInterface(node);
-        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.get_foo1 = function() {};\n\n\nIA.prototype.set_foo1 = function(value) {};");
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\n/**\n * @return {Object}\n */\nIA.prototype.get_foo1 = function() {};\n\n\n/**\n * @param {Object} value\n */\nIA.prototype.set_foo1 = function(value) {};");
     }
 
     @Override
@@ -54,7 +54,7 @@ public class TestFlexJSInterface extends TestGoogInterface
                 + "function baz1():Object;"
                 + "function baz2(value:Object):void;}");
         asBlockWalker.visitInterface(node);
-        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.baz1 = function() {};\n\n\nIA.prototype.baz2 = function(value) {};");
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\n/**\n * @return {Object}\n */\nIA.prototype.baz1 = function() {};\n\n\n/**\n * @param {Object} value\n */\nIA.prototype.baz2 = function(value) {};");
     }
 
     @Override
@@ -67,7 +67,7 @@ public class TestFlexJSInterface extends TestGoogInterface
                 + "function baz1():Object;"
                 + "function baz2(value:Object):void;}");
         asBlockWalker.visitInterface(node);
-        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.get_foo1 = function() {};\n\n\nIA.prototype.set_foo1 = function(value) {};\n\n\nIA.prototype.baz1 = function() {};\n\n\nIA.prototype.baz2 = function(value) {};");
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\n/**\n * @return {Object}\n */\nIA.prototype.get_foo1 = function() {};\n\n\n/**\n * @param {Object} value\n */\nIA.prototype.set_foo1 = function(value) {};\n\n\n/**\n * @return {Object}\n */\nIA.prototype.baz1 = function() {};\n\n\n/**\n * @param {Object} value\n */\nIA.prototype.baz2 = function(value) {};");
     }
 
     protected IBackend createBackend()

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/58352859/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
index df4e612..c41f820 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
@@ -80,6 +80,8 @@ public class TestGoogProject extends ASTestBase
                     + backend.getOutputExtension();
             String compiledResult = readCodeFile(new File(compiledFilePath));
 
+            System.out.println(compiledResult);
+            
             String expectedFilePath = new File("test-files").getAbsolutePath()
                     + File.separator + testDirPath + File.separator
                     + compiledFileName + "_result" + "."

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/58352859/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js b/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
index d1443d7..4ca2e21 100644
--- a/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
+++ b/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
@@ -20,9 +20,15 @@ interfaces.IE = function() {
 interfaces.IE.prototype.myMethod = function() {};
 
 
+/**
+ * @return {string}
+ */
 interfaces.IE.prototype.get_myProp = function() {};
 
 
+/**
+ * @param {string} value
+ */
 interfaces.IE.prototype.set_myProp = function(value) {};
 
 


[7/9] git commit: [flex-falcon] [refs/heads/develop] - Proper JSDoc annotations for interface members.

Posted by er...@apache.org.
Proper JSDoc annotations for interface members.

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/17ccd49c
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/17ccd49c
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/17ccd49c

Branch: refs/heads/develop
Commit: 17ccd49c9510102d7507cea0ef92730190e44e82
Parents: dfa5892
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 11:15:21 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 11:15:21 2013 +0100

----------------------------------------------------------------------
 .../codegen/js/goog/IJSGoogDocEmitter.java      |  3 ++
 .../codegen/js/flexjs/JSFlexJSDocEmitter.java   | 41 ++++++++++++++++++++
 .../codegen/js/flexjs/JSFlexJSEmitter.java      |  2 +
 .../codegen/js/goog/JSGoogDocEmitter.java       |  7 ++++
 4 files changed, 53 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17ccd49c/compiler.jx/src/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java b/compiler.jx/src/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java
index b3d3ad9..6903da8 100644
--- a/compiler.jx/src/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java
@@ -25,6 +25,7 @@ import org.apache.flex.compiler.definitions.IDefinition;
 import org.apache.flex.compiler.definitions.ITypeDefinition;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
 import org.apache.flex.compiler.tree.as.IFunctionNode;
 import org.apache.flex.compiler.tree.as.IInterfaceNode;
 import org.apache.flex.compiler.tree.as.IParameterNode;
@@ -51,6 +52,8 @@ public interface IJSGoogDocEmitter extends IJSDocEmitter
 
     void emitInterfaceDoc(IInterfaceNode node, ICompilerProject project);
 
+    void emitInterfaceMemberDoc(IDefinitionNode node, ICompilerProject project);
+    
     void emitFieldDoc(IVariableNode node, IDefinition def);
 
     void emitMethodDoc(IFunctionNode node, ICompilerProject project);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17ccd49c/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 adb3b60..ab75379 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
@@ -34,6 +34,7 @@ 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.IDefinitionNode;
 import org.apache.flex.compiler.tree.as.IExpressionNode;
 import org.apache.flex.compiler.tree.as.IFunctionNode;
 import org.apache.flex.compiler.tree.as.IParameterNode;
@@ -153,6 +154,46 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
                 end();
         }
     }
+    
+    public void emitInterfaceMemberDoc(IDefinitionNode node, ICompilerProject project)
+    {
+        boolean hasDoc = false;
+        
+        String returnType = ((IFunctionNode) node).getReturnType();
+        if (returnType != ""
+                && returnType != ASEmitterTokens.VOID.getToken()) // has return
+        {
+            begin();
+            hasDoc = true;
+
+            ITypeDefinition tdef = ((IFunctionDefinition)node.getDefinition())
+                    .resolveReturnType(project);
+
+            String packageName = "";
+            if (tdef instanceof InterfaceDefinition)
+                packageName = tdef.getPackageName();
+            else
+                packageName = node.getPackageName();
+            
+            emitReturn((IFunctionNode) node, packageName);
+        }
+
+        IParameterNode[] parameters = ((IFunctionNode) node).getParameterNodes();
+        for (IParameterNode pnode : parameters)
+        {
+            if (!hasDoc)
+            {
+                begin();
+                hasDoc = true;
+            }
+
+            IExpressionNode enode = pnode.getNameExpressionNode();
+            emitParam(pnode, enode.resolveType(project).getPackageName());
+        }
+
+        if (hasDoc)
+            end();
+    }
 
     @Override
     public void emitMethodAccess(IFunctionNode node)

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17ccd49c/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 947a268..e2d26f1 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
@@ -230,6 +230,8 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             writeNewline();
             writeNewline();
 
+            getDoc().emitInterfaceMemberDoc((IFunctionNode) mnode, project);
+            
             write(qname);
             write(ASEmitterTokens.MEMBER_ACCESS);
             write(JSEmitterTokens.PROTOTYPE);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/17ccd49c/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
index 915265a..1ca5781 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
@@ -42,6 +42,7 @@ import org.apache.flex.compiler.internal.semantics.SemanticUtils;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.tree.as.IASNode;
 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.IFunctionNode;
 import org.apache.flex.compiler.tree.as.IInterfaceNode;
@@ -94,6 +95,12 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
         end();
     }
 
+    public void emitInterfaceMemberDoc(IDefinitionNode node, ICompilerProject project)
+    {
+        // (erikdebruin) placeholder method, so we don't have to further complicate
+        //               the interface structure
+    }
+
     @Override
     public void emitFieldDoc(IVariableNode node, IDefinition def)
     {


[2/9] git commit: [flex-falcon] [refs/heads/develop] - Changed the tests for the new interface member emission.

Posted by er...@apache.org.
Changed the tests for the new interface member emission.

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/e3eff8e9
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/e3eff8e9
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/e3eff8e9

Branch: refs/heads/develop
Commit: e3eff8e9191802a7c7b83cefaa06f79ad13dc286
Parents: 15035e6
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Dec 6 10:11:41 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Dec 6 10:11:41 2013 +0100

----------------------------------------------------------------------
 .../codegen/js/flexjs/TestFlexJSInterface.java  | 37 ++++++++++++++++++++
 .../flexjs/projects/interfaces/interfaces/IE.as |  6 +++-
 .../projects/interfaces/interfaces/IE_result.js |  9 +++++
 3 files changed, 51 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e3eff8e9/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
index e2de1df..d95eef1 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
@@ -22,6 +22,8 @@ package org.apache.flex.compiler.internal.codegen.js.flexjs;
 import org.apache.flex.compiler.driver.IBackend;
 import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogInterface;
 import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.junit.Test;
 
 /**
  * This class tests the production of valid 'goog' JS code for Interface
@@ -33,6 +35,41 @@ import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
 public class TestFlexJSInterface extends TestGoogInterface
 {
 
+    @Override
+    @Test
+    public void testAccessors()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function get foo1():Object;"
+                + "function set foo1(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.get_foo1 = function() {};\n\n\nIA.prototype.set_foo1 = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testMethods()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function baz1():Object;"
+                + "function baz2(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.baz1 = function() {};\n\n\nIA.prototype.baz2 = function(value) {};");
+    }
+
+    @Override
+    @Test
+    public void testAccessorsMethods()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function get foo1():Object;"
+                + "function set foo1(value:Object):void;"
+                + "function baz1():Object;"
+                + "function baz2(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n\n\nIA.prototype.get_foo1 = function() {};\n\n\nIA.prototype.set_foo1 = function() {};\n\n\nIA.prototype.baz1 = function() {};\n\n\nIA.prototype.baz2 = function(value) {};");
+    }
+
     protected IBackend createBackend()
     {
         return new FlexJSBackend();

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e3eff8e9/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE.as b/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE.as
index b40e49e..4fe6ad4 100644
--- a/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE.as
+++ b/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE.as
@@ -1,4 +1,8 @@
 package interfaces
 {
-    public interface IE {}
+    public interface IE {
+      function myMethod():void;
+      function get myProp():String;
+      function set myProp(value:String):void;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e3eff8e9/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js b/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
index 1455342..d3f50b1 100644
--- a/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
+++ b/compiler.jx.tests/test-files/flexjs/projects/interfaces/interfaces/IE_result.js
@@ -17,6 +17,15 @@ interfaces.IE = function() {
 };
 
 
+interfaces.IE.prototype.myMethod = function() {};
+
+
+interfaces.IE.prototype.get_myProp = function() {};
+
+
+interfaces.IE.prototype.set_myProp = function() {};
+
+
 /**
  * Metadata
  *