flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [28/42] git commit: [flex-falcon] [refs/heads/develop] - - Added formatQualifiedName() to IJSEmitter. - Removed all casts dealing with formatQualifiedName() addition.
Date Thu, 04 Jun 2015 06:06:34 GMT
- Added formatQualifiedName() to IJSEmitter.
- Removed all casts dealing with formatQualifiedName() addition.


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

Branch: refs/heads/develop
Commit: 83932907f1e6341766a2a4988953e697a601404c
Parents: 1422546
Author: Michael Schmalle <mschmalle@apache.org>
Authored: Sun May 31 14:13:03 2015 -0400
Committer: Frédéric THOMAS <webdoublefx@gmail.com>
Committed: Tue Jun 2 13:41:11 2015 +0100

----------------------------------------------------------------------
 .../flex/compiler/codegen/js/IJSEmitter.java       |  2 ++
 .../compiler/internal/codegen/js/JSEmitter.java    |  8 ++++++++
 .../codegen/js/flexjs/JSFlexJSEmitter.java         | 17 +++++++++--------
 .../internal/codegen/js/goog/JSGoogEmitter.java    | 17 +++++++++--------
 .../internal/codegen/js/jx/AccessorEmitter.java    | 13 +++++++------
 .../internal/codegen/js/jx/AsIsEmitter.java        |  6 +-----
 .../codegen/js/jx/BinaryOperatorEmitter.java       | 10 ++++++----
 .../internal/codegen/js/jx/BindableEmitter.java    |  7 ++-----
 .../internal/codegen/js/jx/ClassEmitter.java       |  2 +-
 .../internal/codegen/js/jx/FieldEmitter.java       | 14 +++++---------
 .../codegen/js/jx/FunctionCallEmitter.java         |  5 +++--
 .../internal/codegen/js/jx/IdentifierEmitter.java  |  8 ++------
 .../codegen/js/jx/MemberAccessEmitter.java         |  7 ++-----
 .../codegen/js/jx/PackageFooterEmitter.java        | 14 ++++++--------
 .../codegen/js/jx/PackageHeaderEmitter.java        |  5 +----
 .../internal/codegen/js/jx/SuperCallEmitter.java   | 10 ++++------
 16 files changed, 68 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java
index 01444e7..5a83ec6 100644
--- a/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java
@@ -34,4 +34,6 @@ import org.apache.flex.compiler.visitor.IASNodeStrategy;
 public interface IJSEmitter extends IASEmitter
 {
     JSSessionModel getModel();
+    
+    String formatQualifiedName(String name);
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
index 4eb6ccb..1c55dcd 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
@@ -49,6 +49,12 @@ public class JSEmitter extends ASEmitter implements IJSEmitter
     }
 
     @Override
+    public String formatQualifiedName(String name)
+    {
+        return name;
+    }
+    
+    @Override
     public void emitLocalNamedFunction(IFunctionNode node)
     {
         FunctionNode fnode = (FunctionNode)node;
@@ -68,4 +74,6 @@ public class JSEmitter extends ASEmitter implements IJSEmitter
         emitFunctionScope(fnode.getScopedNode());
     }
 
+
+
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/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 ec1f3db..5b8b1fe 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
@@ -161,6 +161,15 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     }
 
     @Override
+    public String formatQualifiedName(String name)
+    {
+        if (name.contains("goog.") || name.startsWith("Vector."))
+            return name;
+        name = name.replaceAll("\\.", "_");
+        return name;
+    }
+
+    @Override
     public void emitClass(IClassNode node)
     {
         classEmitter.emit(node);
@@ -447,12 +456,4 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         write(ASEmitterTokens.SINGLE_QUOTE);
     }
 
-    @Override
-    public String formatQualifiedName(String name)
-    {
-        if (name.contains("goog.") || name.startsWith("Vector."))
-            return name;
-        name = name.replaceAll("\\.", "_");
-        return name;
-    }
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/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 77c9094..b685fe0 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,7 @@ 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;
 
@@ -109,6 +109,12 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
     //--------------------------------------------------------------------------
 
     @Override
+    public String formatQualifiedName(String name)
+    {
+        return name;
+    }
+
+    @Override
     public void emitPackageHeader(IPackageDefinition definition)
     {
         IASScope containedScope = definition.getContainedScope();
@@ -545,9 +551,9 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
         IClassNode cnode = (IClassNode) node
                 .getAncestorOfType(IClassNode.class);
 
-        IDefinition def = ((IIdentifierNode) node).resolve(project);
+        IDefinition def = node.resolve(project);
 
-        ITypeDefinition type = ((IIdentifierNode) node).resolveType(project);
+        ITypeDefinition type = node.resolveType(project);
 
         IASNode pnode = node.getParent();
         ASTNodeID inode = pnode.getNodeID();
@@ -1159,9 +1165,4 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
         }
         return list;
     }
-
-    protected String formatQualifiedName(String name)
-    {
-        return name;
-    }
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java
index 0d0bd66..d6311f0 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java
@@ -82,12 +82,12 @@ public class AccessorEmitter extends JSSubEmitter implements
             write(JSEmitterTokens.DEFINE_PROPERTIES);
             write(ASEmitterTokens.PAREN_OPEN);
             String qname = definition.getQualifiedName();
-            write(fjs.formatQualifiedName(qname));
+            write(getEmitter().formatQualifiedName(qname));
             write(ASEmitterTokens.MEMBER_ACCESS);
             write(JSEmitterTokens.PROTOTYPE);
             write(ASEmitterTokens.COMMA);
             write(ASEmitterTokens.SPACE);
-            write("/** @lends {" + fjs.formatQualifiedName(qname)
+            write("/** @lends {" + getEmitter().formatQualifiedName(qname)
                     + ".prototype} */ ");
             writeNewline(ASEmitterTokens.BLOCK_OPEN);
 
@@ -117,7 +117,7 @@ public class AccessorEmitter extends JSSubEmitter implements
                     write(ASEmitterTokens.THIS);
                     write(ASEmitterTokens.SPACE);
                     write(ASEmitterTokens.BLOCK_OPEN);
-                    write(fjs.formatQualifiedName(qname));
+                    write(getEmitter().formatQualifiedName(qname));
                     write(ASEmitterTokens.BLOCK_CLOSE);
                     write(ASEmitterTokens.SPACE);
                     write(JSDocEmitterTokens.JSDOC_CLOSE);
@@ -141,7 +141,7 @@ public class AccessorEmitter extends JSSubEmitter implements
                     write(ASEmitterTokens.THIS);
                     write(ASEmitterTokens.SPACE);
                     write(ASEmitterTokens.BLOCK_OPEN);
-                    write(fjs.formatQualifiedName(qname));
+                    write(getEmitter().formatQualifiedName(qname));
                     write(ASEmitterTokens.BLOCK_CLOSE);
                     write(ASEmitterTokens.SPACE);
                     write(JSDocEmitterTokens.JSDOC_CLOSE);
@@ -164,10 +164,11 @@ public class AccessorEmitter extends JSSubEmitter implements
             write(JSEmitterTokens.DEFINE_PROPERTIES);
             write(ASEmitterTokens.PAREN_OPEN);
             String qname = definition.getQualifiedName();
-            write(fjs.formatQualifiedName(qname));
+            write(getEmitter().formatQualifiedName(qname));
             write(ASEmitterTokens.COMMA);
             write(ASEmitterTokens.SPACE);
-            write("/** @lends {" + fjs.formatQualifiedName(qname) + "} */ ");
+            write("/** @lends {" + getEmitter().formatQualifiedName(qname)
+                    + "} */ ");
             writeNewline(ASEmitterTokens.BLOCK_OPEN);
 
             Set<String> propertyNames = getModel().getStaticPropertyMap()

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java
index 5d243c7..ac45b88 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java
@@ -24,7 +24,6 @@ import org.apache.flex.compiler.codegen.js.IJSEmitter;
 import org.apache.flex.compiler.definitions.IDefinition;
 import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
-import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
 import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
 import org.apache.flex.compiler.tree.ASTNodeID;
 import org.apache.flex.compiler.tree.as.IExpressionNode;
@@ -41,9 +40,6 @@ public class AsIsEmitter extends JSSubEmitter
     public void emitIsAs(IExpressionNode left, IExpressionNode right,
             ASTNodeID id, boolean coercion)
     {
-        // TODO (mschmalle) will remove this cast as more things get abstracted
-        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
-
         // project is null in unit tests
         //IDefinition dnode = project != null ? (right).resolve(project) : null;
         IDefinition dnode = getProject() != null ? (right)
@@ -102,7 +98,7 @@ public class AsIsEmitter extends JSSubEmitter
         writeToken(ASEmitterTokens.COMMA);
 
         if (dnode != null)
-            write(fjs.formatQualifiedName(dnode.getQualifiedName()));
+            write(getEmitter().formatQualifiedName(dnode.getQualifiedName()));
         else
             getWalker().walk(right);
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
index 80ea2c5..e3d151c 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
@@ -73,7 +73,8 @@ public class BinaryOperatorEmitter extends JSSubEmitter implements
             IDefinition dnode = (node.getRightOperandNode())
                     .resolve(getProject());
             if (dnode != null)
-                write(fjs.formatQualifiedName(dnode.getQualifiedName()));
+                write(getEmitter()
+                        .formatQualifiedName(dnode.getQualifiedName()));
             else
                 getWalker().walk(node.getRightOperandNode());
         }
@@ -102,7 +103,8 @@ public class BinaryOperatorEmitter extends JSSubEmitter implements
                         write(ASEmitterTokens.PAREN_OPEN);
                         IClassNode cnode = (IClassNode) node
                                 .getAncestorOfType(IClassNode.class);
-                        write(fjs.formatQualifiedName(cnode.getQualifiedName()));
+                        write(getEmitter().formatQualifiedName(
+                                cnode.getQualifiedName()));
                         writeToken(ASEmitterTokens.COMMA);
                         write(ASEmitterTokens.THIS);
                         writeToken(ASEmitterTokens.COMMA);
@@ -117,8 +119,8 @@ public class BinaryOperatorEmitter extends JSSubEmitter implements
                             write(ASEmitterTokens.MEMBER_ACCESS);
                             write(JSFlexJSEmitterTokens.SUPERSETTER);
                             write(ASEmitterTokens.PAREN_OPEN);
-                            write(fjs.formatQualifiedName(cnode
-                                    .getQualifiedName()));
+                            write(getEmitter().formatQualifiedName(
+                                    cnode.getQualifiedName()));
                             writeToken(ASEmitterTokens.COMMA);
                             write(ASEmitterTokens.THIS);
                             writeToken(ASEmitterTokens.COMMA);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
index 0ec3fd2..d2cd20c 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
@@ -39,9 +39,6 @@ public class BindableEmitter extends JSSubEmitter implements
     @Override
     public void emit(IClassDefinition definition)
     {
-        // TODO (mschmalle) will remove this cast as more things get abstracted
-        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
-
         if (getModel().hasBindableVars())
         {
             write(JSGoogEmitterTokens.OBJECT);
@@ -49,12 +46,12 @@ public class BindableEmitter extends JSSubEmitter implements
             write(JSEmitterTokens.DEFINE_PROPERTIES);
             write(ASEmitterTokens.PAREN_OPEN);
             String qname = definition.getQualifiedName();
-            write(fjs.formatQualifiedName(qname));
+            write(getEmitter().formatQualifiedName(qname));
             write(ASEmitterTokens.MEMBER_ACCESS);
             write(JSEmitterTokens.PROTOTYPE);
             write(ASEmitterTokens.COMMA);
             write(ASEmitterTokens.SPACE);
-            write("/** @lends {" + fjs.formatQualifiedName(qname)
+            write("/** @lends {" + getEmitter().formatQualifiedName(qname)
                     + ".prototype} */ ");
             writeNewline(ASEmitterTokens.BLOCK_OPEN);
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
index 516bd98..ff83a52 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
@@ -76,7 +76,7 @@ public class ClassEmitter extends JSSubEmitter implements
                 String qname = definition.getQualifiedName();
                 if (qname != null && !qname.equals(""))
                 {
-                    write(fjs.formatQualifiedName(qname));
+                    write(getEmitter().formatQualifiedName(qname));
                     write(ASEmitterTokens.SPACE);
                     writeToken(ASEmitterTokens.EQUAL);
                     write(ASEmitterTokens.FUNCTION);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java
index d63ffde..957751f 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java
@@ -28,7 +28,6 @@ import org.apache.flex.compiler.definitions.IDefinition;
 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.JSSubEmitter;
-import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
 import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
 import org.apache.flex.compiler.internal.tree.as.ChainedVariableNode;
 import org.apache.flex.compiler.tree.ASTNodeID;
@@ -47,9 +46,6 @@ public class FieldEmitter extends JSSubEmitter implements
     @Override
     public void emit(IVariableNode node)
     {
-        // TODO (mschmalle) will remove this cast as more things get abstracted
-        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
-
         IDefinition definition = EmitterUtils.getClassDefinition(node);
 
         IDefinition def = null;
@@ -60,9 +56,9 @@ public class FieldEmitter extends JSSubEmitter implements
         }
         
         // TODO (mschmalle)
-        if (fjs.getDocEmitter() instanceof IJSGoogDocEmitter)
+        if (getEmitter().getDocEmitter() instanceof IJSGoogDocEmitter)
         {
-            ((IJSGoogDocEmitter) fjs.getDocEmitter()).emitFieldDoc(node, def);
+            ((IJSGoogDocEmitter) getEmitter().getDocEmitter()).emitFieldDoc(node, def);
         }
 
         IDefinition ndef = node.getDefinition();
@@ -78,7 +74,7 @@ public class FieldEmitter extends JSSubEmitter implements
         if (definition == null)
             definition = ndef.getContainingScope().getDefinition();
 
-        write(fjs.formatQualifiedName(definition.getQualifiedName())
+        write(getEmitter().formatQualifiedName(definition.getQualifiedName())
                 + ASEmitterTokens.MEMBER_ACCESS.getToken() + root
                 + node.getName());
 
@@ -87,7 +83,7 @@ public class FieldEmitter extends JSSubEmitter implements
         {
             write(ASEmitterTokens.SPACE);
             writeToken(ASEmitterTokens.EQUAL);
-            fjs.getWalker().walk(vnode);
+            getEmitter().getWalker().walk(vnode);
         }
 
         if (!(node instanceof ChainedVariableNode))
@@ -100,7 +96,7 @@ public class FieldEmitter extends JSSubEmitter implements
                 {
                     writeNewline(ASEmitterTokens.SEMICOLON);
                     writeNewline();
-                    fjs.emitField((IVariableNode) child);
+                    getEmitter().emitField((IVariableNode) child);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
index 00bdf18..788cd75 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
@@ -79,10 +79,11 @@ public class FunctionCallEmitter extends JSSubEmitter implements
                 def = node.resolveCalledExpression(getProject());
                 // all new calls to a class should be fully qualified names
                 if (def instanceof ClassDefinition)
-                    write(fjs.formatQualifiedName(def.getQualifiedName()));
+                    write(getEmitter().formatQualifiedName(
+                            def.getQualifiedName()));
                 else
                     // I think we still need this for "new someVarOfTypeClass"
-                    fjs.getWalker().walk(node.getNameNode());
+                    getEmitter().getWalker().walk(node.getNameNode());
                 write(ASEmitterTokens.PAREN_OPEN);
                 fjs.walkArguments(node.getArgumentNodes());
                 write(ASEmitterTokens.PAREN_CLOSE);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
index 3af251d..9c5dcd9 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
@@ -25,7 +25,6 @@ import org.apache.flex.compiler.definitions.IDefinition;
 import org.apache.flex.compiler.definitions.IFunctionDefinition.FunctionClassification;
 import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
-import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
 import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
@@ -48,9 +47,6 @@ public class IdentifierEmitter extends JSSubEmitter implements
     @Override
     public void emit(IIdentifierNode node)
     {
-        // TODO (mschmalle) will remove this cast as more things get abstracted
-        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
-
         IDefinition nodeDef = ((IIdentifierNode) node).resolve(getProject());
 
         IASNode parentNode = node.getParent();
@@ -67,7 +63,7 @@ public class IdentifierEmitter extends JSSubEmitter implements
             String sname = nodeDef.getParent().getQualifiedName();
             if (sname.length() > 0)
             {
-                write(fjs.formatQualifiedName(sname));
+                write(getEmitter().formatQualifiedName(sname));
                 write(ASEmitterTokens.MEMBER_ACCESS);
             }
         }
@@ -119,7 +115,7 @@ public class IdentifierEmitter extends JSSubEmitter implements
         if (emitName)
         {
             if (nodeDef != null)
-                write(fjs.formatQualifiedName(nodeDef.getQualifiedName()));
+                write(getEmitter().formatQualifiedName(nodeDef.getQualifiedName()));
             else
                 write(node.getName());
         }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
index b582915..9bce1ae 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
@@ -24,7 +24,6 @@ import org.apache.flex.compiler.codegen.js.IJSEmitter;
 import org.apache.flex.compiler.definitions.IDefinition;
 import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
-import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
 import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
 import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
 import org.apache.flex.compiler.internal.tree.as.GetterNode;
@@ -49,9 +48,6 @@ public class MemberAccessEmitter extends JSSubEmitter implements
     @Override
     public void emit(IMemberAccessExpressionNode node)
     {
-        // TODO (mschmalle) will remove this cast as more things get abstracted
-        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
-
         if (ASNodeUtils.hasParenOpen(node))
             write(ASEmitterTokens.PAREN_OPEN);
 
@@ -117,7 +113,8 @@ public class MemberAccessEmitter extends JSSubEmitter implements
                     write(ASEmitterTokens.PAREN_OPEN);
                     IClassNode cnode = (IClassNode) node
                             .getAncestorOfType(IClassNode.class);
-                    write(fjs.formatQualifiedName(cnode.getQualifiedName()));
+                    write(getEmitter().formatQualifiedName(
+                            cnode.getQualifiedName()));
                     writeToken(ASEmitterTokens.COMMA);
                     write(ASEmitterTokens.THIS);
                     writeToken(ASEmitterTokens.COMMA);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
index 86ac18d..1b4b729 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
@@ -27,7 +27,6 @@ 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.JSSubEmitter;
 import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSDocEmitter;
-import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
 import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
 import org.apache.flex.compiler.scopes.IASScope;
@@ -54,9 +53,8 @@ public class PackageFooterEmitter extends JSSubEmitter implements
         if (type == null)
             return;
 
-        // TODO (mschmalle) will remove this cast as more things get abstracted
-        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
-        JSFlexJSDocEmitter doc = (JSFlexJSDocEmitter) fjs.getDocEmitter();
+        JSFlexJSDocEmitter doc = (JSFlexJSDocEmitter) getEmitter()
+                .getDocEmitter();
 
         ITypeNode tnode = EmitterUtils.findTypeNode(definition.getNode());
         if (tnode != null)
@@ -76,7 +74,7 @@ public class PackageFooterEmitter extends JSSubEmitter implements
             doc.end();
 
             // a.B.prototype.AFJS_CLASS_INFO = {  };
-            write(fjs.formatQualifiedName(type.getQualifiedName()));
+            write(getEmitter().formatQualifiedName(type.getQualifiedName()));
             write(ASEmitterTokens.MEMBER_ACCESS);
             write(JSEmitterTokens.PROTOTYPE);
             write(ASEmitterTokens.MEMBER_ACCESS);
@@ -98,7 +96,7 @@ public class PackageFooterEmitter extends JSSubEmitter implements
             write(JSFlexJSEmitterTokens.QNAME);
             writeToken(ASEmitterTokens.COLON);
             write(ASEmitterTokens.SINGLE_QUOTE);
-            write(fjs.formatQualifiedName(tnode.getQualifiedName()));
+            write(getEmitter().formatQualifiedName(tnode.getQualifiedName()));
             write(ASEmitterTokens.SINGLE_QUOTE);
             write(ASEmitterTokens.BLOCK_CLOSE);
             write(ASEmitterTokens.SQUARE_CLOSE);
@@ -120,8 +118,8 @@ public class PackageFooterEmitter extends JSSubEmitter implements
                 int i = 0;
                 for (IExpressionNode enode : enodes)
                 {
-                    write(fjs.formatQualifiedName(enode.resolve(getProject())
-                            .getQualifiedName()));
+                    write(getEmitter().formatQualifiedName(
+                            enode.resolve(getProject()).getQualifiedName()));
                     if (i < enodes.length - 1)
                         writeToken(ASEmitterTokens.COMMA);
                     i++;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
index cd82cf2..da13f75 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
@@ -53,9 +53,6 @@ public class PackageHeaderEmitter extends JSSubEmitter implements
     @Override
     public void emit(IPackageDefinition definition)
     {
-        // TODO (mschmalle) will remove this cast as more things get abstracted
-        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
-
         IASScope containedScope = definition.getContainedScope();
         ITypeDefinition type = EmitterUtils.findType(containedScope
                 .getAllLocalDefinitions());
@@ -75,7 +72,7 @@ public class PackageHeaderEmitter extends JSSubEmitter implements
         write(JSGoogEmitterTokens.GOOG_PROVIDE);
         write(ASEmitterTokens.PAREN_OPEN);
         write(ASEmitterTokens.SINGLE_QUOTE);
-        write(fjs.formatQualifiedName(type.getQualifiedName()));
+        write(getEmitter().formatQualifiedName(type.getQualifiedName()));
         write(ASEmitterTokens.SINGLE_QUOTE);
         write(ASEmitterTokens.PAREN_CLOSE);
         writeNewline(ASEmitterTokens.SEMICOLON);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/83932907/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
index 90c3bdb..8e48678 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
@@ -45,14 +45,10 @@ public class SuperCallEmitter extends JSSubEmitter
     public SuperCallEmitter(IJSEmitter emitter)
     {
         super(emitter);
-        // TODO Auto-generated constructor stub
     }
 
     public void emit(IASNode node, String type)
     {
-        // TODO (mschmalle) will remove this cast as more things get abstracted
-        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
-
         IFunctionNode fnode = (node instanceof IFunctionNode) ? (IFunctionNode) node
                 : null;
         IFunctionCallNode fcnode = (node instanceof IFunctionCallNode) ? (FunctionCallNode)
node
@@ -89,9 +85,11 @@ public class SuperCallEmitter extends JSSubEmitter
                     write(JSFlexJSEmitterTokens.SUPERSETTER);
                 write(ASEmitterTokens.PAREN_OPEN);
                 if (cnode == null && thisClass != null)
-                    write(fjs.formatQualifiedName(thisClass.getQualifiedName()));
+                    write(getEmitter().formatQualifiedName(
+                            thisClass.getQualifiedName()));
                 else
-                    write(fjs.formatQualifiedName(cnode.getQualifiedName()));
+                    write(getEmitter().formatQualifiedName(
+                            cnode.getQualifiedName()));
                 writeToken(ASEmitterTokens.COMMA);
                 write(ASEmitterTokens.THIS);
                 writeToken(ASEmitterTokens.COMMA);


Mime
View raw message