You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2016/05/06 18:00:43 UTC

[1/4] git commit: [flex-falcon] [refs/heads/develop] - externc: added getTypeDefReference() to ReferenceModel to match getClassReference() and getInterfaceReference()

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 70ebabf9f -> 097f6ba91


externc: added getTypeDefReference() to ReferenceModel to match getClassReference() and getInterfaceReference()


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

Branch: refs/heads/develop
Commit: c492dcc2debc7e83bcbd11f61f1836f99f651a0b
Parents: b921b9b
Author: Josh Tynjala <jo...@gmail.com>
Authored: Fri May 6 10:24:03 2016 -0700
Committer: Josh Tynjala <jo...@gmail.com>
Committed: Fri May 6 10:24:03 2016 -0700

----------------------------------------------------------------------
 .../internal/codegen/externals/reference/ReferenceModel.java    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c492dcc2/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java
index 090eb63..15623ad 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java
@@ -110,6 +110,11 @@ public class ReferenceModel
         return null;
     }
 
+    public ClassReference getTypeDefReference(String qualifiedName)
+    {
+        return typedefs.get(qualifiedName);
+    }
+
     public void addNamespace(Node node, String qualifiedName)
     {
         if (namespaces.contains(qualifiedName))


[3/4] git commit: [flex-falcon] [refs/heads/develop] - externc: fixed issue where typedefs were incorrectly emitted as static variables

Posted by jo...@apache.org.
externc: fixed issue where typedefs were incorrectly emitted as static variables


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

Branch: refs/heads/develop
Commit: 86de6a65773b5e1198c57b4fa0022ae5bc4bce3e
Parents: 84b7e80
Author: Josh Tynjala <jo...@gmail.com>
Authored: Fri May 6 10:56:32 2016 -0700
Committer: Josh Tynjala <jo...@gmail.com>
Committed: Fri May 6 10:56:32 2016 -0700

----------------------------------------------------------------------
 .../internal/codegen/externals/pass/AddMemberPass.java  | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/86de6a65/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java
index 9308ff0..732b9e9 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java
@@ -82,9 +82,15 @@ public class AddMemberPass extends AbstractCompilerPass
                 else if (first.isGetProp())
                 {
                     JSDocInfo jsDocInfo = first.getJSDocInfo();
-                    if (jsDocInfo != null
-                        && (jsDocInfo.getParameterCount() > 0
-                            || jsDocInfo.getReturnType() != null))
+                    if (jsDocInfo != null && jsDocInfo.hasTypedefType())
+                    {
+                        // this is a typedef, and not a member. it was
+                        // already handled during the collect types pass.
+                        continue;
+                    }
+                    else if(jsDocInfo != null 
+                            && (jsDocInfo.getParameterCount() > 0
+                                || jsDocInfo.getReturnType() != null))
                     {
                         // instance or static method that isn't declared as a
                         // function, but has @param or @returns


[2/4] git commit: [flex-falcon] [refs/heads/develop] - externc: typedefs for function signatures are now recognized, and Function is emitted in ActionScript

Posted by jo...@apache.org.
externc: typedefs for function signatures are now recognized, and Function is emitted in ActionScript


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

Branch: refs/heads/develop
Commit: 84b7e80e5c7a823ba25f6ba537568f1e3ebf2a72
Parents: c492dcc
Author: Josh Tynjala <jo...@gmail.com>
Authored: Fri May 6 10:28:35 2016 -0700
Committer: Josh Tynjala <jo...@gmail.com>
Committed: Fri May 6 10:28:35 2016 -0700

----------------------------------------------------------------------
 .../codegen/externals/utils/JSTypeUtils.java    | 32 +++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/84b7e80e/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java
index c14ddb8..217c61b 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java
@@ -98,8 +98,20 @@ public class JSTypeUtils
 
     public static String transformType(String type)
     {
+        // a comment in the type might contain |, so strip the comment first
+        String typeWithoutComment = type;
+        int startIndex = typeWithoutComment.indexOf(" /*");
+        if (startIndex != -1)
+        {
+            int endIndex = typeWithoutComment.indexOf("*/", startIndex);
+            if (endIndex != -1)
+            {
+                typeWithoutComment = typeWithoutComment.substring(0, startIndex) +
+                        typeWithoutComment.substring(endIndex + 2);
+            }
+        }
         // XXX This is an error but, needs to be reduced in @param union
-        if (type.indexOf("|") != -1)
+        if (typeWithoutComment.indexOf("|") != -1)
             return "Object";
 
         HashMap<String, String> map = new HashMap<String, String>();
@@ -164,6 +176,24 @@ public class JSTypeUtils
                 jsType = jsType2;
         }
 
+        ClassReference typeDef = model.getTypeDefReference(jsType.getDisplayName());
+        if (typeDef != null)
+        {
+            JSTypeExpression typeDefTypeExpression = typeDef.getComment().getTypedefType();
+            if (typeDefTypeExpression != null)
+            {
+                JSType typeDefJSType = getJsType(model, typeDefTypeExpression);
+                if (typeDefJSType.isFunctionType())
+                {
+                    // I'm not sure what the implications would be when
+                    // returning the JSType for any typedef, so I'm limiting it
+                    // to function typedefs for now. this should be
+                    // revisited eventually. -JT
+                    jsType = typeDefJSType;
+                }
+            }
+        }
+
         return jsType;
     }
 }


[4/4] git commit: [flex-falcon] [refs/heads/develop] - Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/flex-falcon into develop

Posted by jo...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/flex-falcon into develop


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

Branch: refs/heads/develop
Commit: 097f6ba91af3fa4865df5280ab20bdb661ba06c2
Parents: 86de6a6 70ebabf
Author: Josh Tynjala <jo...@gmail.com>
Authored: Fri May 6 10:56:43 2016 -0700
Committer: Josh Tynjala <jo...@gmail.com>
Committed: Fri May 6 10:56:43 2016 -0700

----------------------------------------------------------------------
 compiler-jx/pom.xml                                   |  4 ++--
 externs/GCL/pom.xml                                   |  3 +++
 externs/cordova/pom.xml                               |  3 ++-
 externs/createjs/pom.xml                              |  1 +
 externs/google_maps/pom.xml                           |  3 ++-
 externs/jasmine/pom.xml                               |  1 +
 externs/jquery/pom.xml                                |  1 +
 externs/js/pom.xml                                    |  1 +
 externs/node/pom.xml                                  |  1 +
 .../org/apache/flex/maven/flexjs/CompileASMojo.java   |  5 ++++-
 .../org/apache/flex/maven/flexjs/CompileJSMojo.java   | 14 +-------------
 .../src/main/resources/config/compile-js-config.xml   |  8 ++++++--
 installer.xml                                         |  2 +-
 13 files changed, 26 insertions(+), 21 deletions(-)
----------------------------------------------------------------------