flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshtynj...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - externc: does not emit typedefs for functions because they are replaced by Function type in ActionScript
Date Fri, 06 May 2016 18:48:20 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 097f6ba91 -> 1e1f6a99b


externc: does not emit typedefs for functions because they are replaced by Function type 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/1e1f6a99
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/1e1f6a99
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/1e1f6a99

Branch: refs/heads/develop
Commit: 1e1f6a99bf2945b5bb6bf04eb16369bb1e2b57ff
Parents: 097f6ba
Author: Josh Tynjala <joshtynjala@gmail.com>
Authored: Fri May 6 11:48:14 2016 -0700
Committer: Josh Tynjala <joshtynjala@gmail.com>
Committed: Fri May 6 11:48:14 2016 -0700

----------------------------------------------------------------------
 .../codegen/externals/emit/ReferenceEmitter.java    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1e1f6a99/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java
index c7d3c45..ed30377 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java
@@ -29,6 +29,9 @@ import org.apache.flex.compiler.internal.codegen.externals.reference.ConstantRef
 import org.apache.flex.compiler.internal.codegen.externals.reference.FunctionReference;
 import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
 
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.jstype.JSType;
+
 public class ReferenceEmitter
 {
     private ReferenceModel model;
@@ -117,6 +120,19 @@ public class ReferenceEmitter
             if (model.getConfiguration().isExternalExtern(reference))
                 continue;
 
+            JSDocInfo comment = reference.getComment();
+            if (comment != null)
+            {
+                JSType typeDefJSType = model.evaluate(comment.getTypedefType());
+                if (typeDefJSType.isFunctionType())
+                {
+                    // typedefs for functions don't need to be emitted because the
+                    // ActionScript Function type doesn't have a way to specify a
+                    // function signature.
+                    continue;
+                }
+            }
+
             emit(reference, sb);
 
             File sourceFile = reference.getFile(model.getConfiguration().getAsTypeDefRoot());


Mime
View raw message