You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ms...@apache.org on 2015/05/31 19:07:08 UTC

git commit: [flex-falcon] [refs/heads/develop] - - Fixed a bug in JSGoogDocEmitter where the project was not resolved and thus the test was faulty not showing it's qualified name. * The bug was responsible for 2 tests failing, when there is no type

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 0610fdb6a -> e3548616e


- Fixed a bug in JSGoogDocEmitter where the project was not resolved
and thus the test was faulty not showing it's qualified name.
  * The bug was responsible for 2 tests failing, when there is no type
    the visitor test failt, just put an if() in to fix it.
- Removed the project reference from JSFlexJSEmitter.


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

Branch: refs/heads/develop
Commit: e3548616ead7817ceda859f414524e21742fc2a8
Parents: 0610fdb
Author: Michael Schmalle <ms...@apache.org>
Authored: Sun May 31 13:06:43 2015 -0400
Committer: Michael Schmalle <ms...@apache.org>
Committed: Sun May 31 13:06:43 2015 -0400

----------------------------------------------------------------------
 .../flexjs/files/wildcard_import_result.js      |  2 +-
 .../codegen/js/flexjs/JSFlexJSEmitter.java      |  8 +---
 .../codegen/js/goog/JSGoogDocEmitter.java       | 39 +++++++++++---------
 .../internal/codegen/js/goog/JSGoogEmitter.java |  3 +-
 4 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e3548616/compiler.jx.tests/test-files/flexjs/files/wildcard_import_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/files/wildcard_import_result.js b/compiler.jx.tests/test-files/flexjs/files/wildcard_import_result.js
index 72981e3..1ee8469 100644
--- a/compiler.jx.tests/test-files/flexjs/files/wildcard_import_result.js
+++ b/compiler.jx.tests/test-files/flexjs/files/wildcard_import_result.js
@@ -61,7 +61,7 @@ wildcard_import.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'wildcard_import
  * @private
  */
 wildcard_import.prototype.tmp = function() {
-  var /** @type {Button} */ myButton;
+  var /** @type {org_apache_flex_html_Button} */ myButton;
   myButton = new org_apache_flex_html_Button();
 };
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e3548616/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 2460d3f..ec1f3db 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
@@ -199,9 +199,6 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     public void emitIdentifier(IIdentifierNode node)
     {
         // TODO (mschmalle) remove when project field is removed
-        if (project == null)
-            project = getWalker().getProject();
-
         identifierEmitter.emit(node);
     }
 
@@ -229,9 +226,6 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     public void emitMemberAccessExpression(IMemberAccessExpressionNode node)
     {
         // TODO (mschmalle) remove when project field is removed
-        if (project == null)
-            project = getWalker().getProject();
-
         memberAccessEmitter.emit(node);
     }
 
@@ -280,7 +274,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         }
         if (isBindableSetter)
         {
-            getDoc().emitMethodDoc(fn, project);
+            getDoc().emitMethodDoc(fn, getWalker().getProject());
             write(formatQualifiedName(type.getQualifiedName()));
             if (!node.hasModifier(ASModifier.STATIC))
             {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e3548616/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 0f8f960..e402ac9 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
@@ -74,7 +74,8 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
             IDefinition dnode = inode.resolve(project);
             if (dnode != null)
             {
-                emitJSDocLine(ASEmitterTokens.EXTENDS, formatQualifiedName(dnode.getQualifiedName()));
+                emitJSDocLine(ASEmitterTokens.EXTENDS,
+                        formatQualifiedName(dnode.getQualifiedName()));
             }
             else
             {
@@ -82,7 +83,7 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
                 break;
             }
         }
-        
+
         if (!hasQualifiedNames)
         {
             String[] inames = node.getExtendedInterfaces();
@@ -95,7 +96,8 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
         end();
     }
 
-    public void emitInterfaceMemberDoc(IDefinitionNode node, ICompilerProject project)
+    public void emitInterfaceMemberDoc(IDefinitionNode node,
+            ICompilerProject project)
     {
         // (erikdebruin) placeholder method, so we don't have to further complicate
         //               the interface structure
@@ -172,7 +174,7 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
                     begin();
                     emitMethodAccess(node);
                     hasDoc = true;
-                    
+
                     emitThis(classDefinition, classDefinition.getPackageName());
                 }
             }
@@ -231,9 +233,9 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
 
     public void emitMethodAccess(IFunctionNode node)
     {
-    	// do nothing
+        // do nothing
     }
-    
+
     @Override
     public void emitVarDoc(IVariableNode node, IDefinition def)
     {
@@ -246,14 +248,15 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
             IDefinition ndef = node.getDefinition();
             if (emitter != null && emitter instanceof JSFlexJSEmitter)
             {
-                ICompilerProject project = ((JSFlexJSEmitter)emitter).project;
-                if (project != null)
+                ICompilerProject project = ((JSFlexJSEmitter) emitter)
+                        .getWalker().getProject();
+                ITypeDefinition type = ndef.resolveType(project);
+                if (type != null)
                 {
-                    packageName = ((ITypeDefinition)ndef.resolveType(project))
-                            .getPackageName();
+                    packageName = ((ITypeDefinition) type).getPackageName();
                 }
             }
-            
+
             emitTypeShort(node, packageName);
         }
         else
@@ -282,7 +285,8 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
     @Override
     public void emitImplements(ITypeDefinition definition, String packageName)
     {
-        emitJSDocLine(ASEmitterTokens.IMPLEMENTS, formatQualifiedName(definition.getQualifiedName()));
+        emitJSDocLine(ASEmitterTokens.IMPLEMENTS,
+                formatQualifiedName(definition.getQualifiedName()));
     }
 
     @Override
@@ -485,7 +489,8 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
 
         if (result == "")
             result = (pname != "" && !isBuiltinFunction && name.indexOf(".") < 0) ? pname
-                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + name : name;
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + name
+                    : name;
 
         result = result.replace(IASLanguageConstants.String,
                 IASLanguageConstants.String.toLowerCase());
@@ -501,17 +506,17 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
 
         IClassNode cnode = (IClassNode) node
                 .getAncestorOfType(IClassNode.class);
-        
+
         // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
         if (cnode == null)
             return null;
-        
+
         return cnode.getDefinition();
     }
-    
+
     protected String formatQualifiedName(String name)
     {
-    	return name;
+        return name;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e3548616/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 530a381..77c9094 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
@@ -84,7 +84,8 @@ import org.apache.flex.compiler.utils.ASNodeUtils;
 public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
 {
     protected List<String> propertyNames = new ArrayList<String>();
-
+    
+    // TODO (mschmalle) Remove this (not used in JSFlexJSEmitter and JSGoogEmitter anymore)
     public ICompilerProject project;
 
     protected IJSGoogDocEmitter getDoc()