flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/2] git commit: [flex-falcon] [refs/heads/develop] - [BUGFIX] Add constructor annotations for implicit bindable implementations, fixes issue with 'remove-circulars'
Date Fri, 02 Sep 2016 23:35:33 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 313f27b96 -> 4b149f4d4


[BUGFIX] Add constructor annotations for implicit bindable implementations, fixes issue with
'remove-circulars'


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

Branch: refs/heads/develop
Commit: b4103327a1dc4da41705e6c23c7160f26d70e4b8
Parents: 30616f6
Author: greg-dove <greg.dove@gmail.com>
Authored: Sat Sep 3 06:55:38 2016 +1200
Committer: greg-dove <greg.dove@gmail.com>
Committed: Sat Sep 3 06:55:38 2016 +1200

----------------------------------------------------------------------
 .../codegen/js/flexjs/JSFlexJSDocEmitter.java   | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b4103327/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
index b94d0b0..ef06e5a 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
@@ -36,7 +36,9 @@ 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.JSSessionModel;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.BindableEmitter;
 import org.apache.flex.compiler.internal.scopes.ASScope;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.tree.as.IDefinitionNode;
@@ -129,18 +131,36 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
                 IClassDefinition superClass = parent.resolveBaseClass(project);
                 String qname = (superClass != null) ? project.getActualPackageName(superClass.getQualifiedName())
: null;
 
+                //support implicit bindable implementation for 'Extends' EventDispatcher:
+                if (superClass == null || qname.equals(IASLanguageConstants.Object)) {
+                    if (((JSFlexJSEmitter)emitter).getModel().getImplicitBindableImplementation()
+                            == JSSessionModel.ImplicitBindableImplementation.EXTENDS) {
+                        superClass = (IClassDefinition) project.resolveQNameToDefinition(BindableEmitter.DISPATCHER_CLASS_QNAME);
+                        if (superClass == null) {
+                            System.out.println(BindableEmitter.DISPATCHER_CLASS_QNAME+" not
resolved for implicit super class in "+classDefinition.getQualifiedName());
+                        } else qname = BindableEmitter.DISPATCHER_CLASS_QNAME;
+                    }
+                }
+
                 if (superClass != null
                         && !qname.equals(IASLanguageConstants.Object))
                     emitExtends(superClass, superClass.getPackageName());
 
                 IReference[] references = classDefinition
                         .getImplementedInterfaceReferences();
+
+                Boolean sawIEventDispatcher = false;
+                Boolean needsIEventDispatcher = ((JSFlexJSEmitter)emitter).getModel().getImplicitBindableImplementation()
+                                                == JSSessionModel.ImplicitBindableImplementation.IMPLEMENTS;
+
                 for (IReference iReference : references)
                 {
                     ITypeDefinition type = (ITypeDefinition) iReference
                             .resolve(project, (ASScope) classDefinition
                                     .getContainingScope(),
                                     DependencyType.INHERITANCE, true);
+                    if (type.getQualifiedName() == BindableEmitter.DISPATCHER_INTERFACE_QNAME)
+                        sawIEventDispatcher=true;
                     if (type == null) {
                         System.out.println(iReference.getDisplayString()
                                 + " not resolved in "
@@ -149,6 +169,15 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
                         emitImplements(type, project.getActualPackageName(type.getPackageName()));
                     }
                 }
+                //support implicit bindable implementation for 'implements' IEventDispatcher:
+                if (needsIEventDispatcher && !sawIEventDispatcher) {
+                    ITypeDefinition type = (ITypeDefinition) project.resolveQNameToDefinition(BindableEmitter.DISPATCHER_INTERFACE_QNAME);
+                    if (type == null) {
+                        System.out.println(BindableEmitter.DISPATCHER_INTERFACE_QNAME+" not
resolved for implicit implementation in "+classDefinition.getQualifiedName());
+                    } else {
+                        emitImplements(type, project.getActualPackageName(type.getPackageName()));
+                    }
+                }
             }
             else
             {


Mime
View raw message