flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshtynj...@apache.org
Subject [22/33] git commit: [flex-falcon] [refs/heads/develop] - compiler.jx: emitParameters() accepts the result of getParametersContainerNode() instead of getParameterNodes() so that the parentheses that are emitted match up with the AST node that actually inc
Date Tue, 05 Apr 2016 23:56:40 GMT
compiler.jx: emitParameters() accepts the result of getParametersContainerNode() instead of
getParameterNodes() so that the parentheses that are emitted match up with the AST node that
actually includes them (which will help with source maps)


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

Branch: refs/heads/develop
Commit: fd2f51c66c01b86c8d5cd4647cb35ebd511870ba
Parents: f31918b
Author: Josh Tynjala <joshtynjala@apache.org>
Authored: Fri Apr 1 10:49:09 2016 -0700
Committer: Josh Tynjala <joshtynjala@apache.org>
Committed: Fri Apr 1 10:49:09 2016 -0700

----------------------------------------------------------------------
 .../flex/compiler/internal/codegen/as/ASEmitter.java  | 14 +++++++-------
 .../flex/compiler/internal/codegen/js/JSEmitter.java  | 12 ++++++------
 .../internal/codegen/js/amd/JSAMDEmitter.java         |  6 +++---
 .../internal/codegen/js/goog/JSGoogEmitter.java       |  6 +++---
 .../internal/codegen/js/jx/AccessorEmitter.java       | 10 +++++-----
 .../codegen/js/jx/DefinePropertyFunctionEmitter.java  |  2 +-
 .../internal/codegen/js/jx/InterfaceEmitter.java      |  2 +-
 .../internal/codegen/js/jx/MethodEmitter.java         |  2 +-
 .../codegen/js/jx/ObjectDefinePropertyEmitter.java    |  4 ++--
 .../internal/codegen/js/vf2js/JSVF2JSEmitter.java     |  6 +++---
 10 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
index 0a0daa3..53ce765 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
@@ -651,7 +651,7 @@ public class ASEmitter implements IASEmitter, IEmitter
         }
 
         emitMemberName(node);
-        emitParameters(node.getParameterNodes());
+        emitParameters(node.getParametersContainerNode());
         emitType(node.getReturnTypeNode());
         if (node.getParent().getParent().getNodeID() == ASTNodeID.ClassID)
         {
@@ -693,7 +693,7 @@ public class ASEmitter implements IASEmitter, IEmitter
         write(ASEmitterTokens.FUNCTION);
         write(ASEmitterTokens.SPACE);
         write(fnode.getName());
-        emitParameters(fnode.getParameterNodes());
+        emitParameters(fnode.getParametersContainerNode());
         emitType(fnode.getTypeNode());
         emitFunctionScope(fnode.getScopedNode());
     }
@@ -703,7 +703,7 @@ public class ASEmitter implements IASEmitter, IEmitter
     {
         FunctionNode fnode = node.getFunctionNode();
         write(ASEmitterTokens.FUNCTION);
-        emitParameters(fnode.getParameterNodes());
+        emitParameters(fnode.getParametersContainerNode());
         emitType(fnode.getTypeNode());
         emitFunctionScope(fnode.getScopedNode());
     }
@@ -772,14 +772,14 @@ public class ASEmitter implements IASEmitter, IEmitter
         getWalker().walk(node.getNameExpressionNode());
     }
 
-    public void emitParameters(IParameterNode[] nodes)
+    public void emitParameters(IContainerNode node)
     {
         write(ASEmitterTokens.PAREN_OPEN);
-        int len = nodes.length;
+        int len = node.getChildCount();
         for (int i = 0; i < len; i++)
         {
-            IParameterNode node = nodes[i];
-            getWalker().walk(node); //emitParameter
+            IParameterNode parameterNode = (IParameterNode) node.getChild(i);
+            getWalker().walk(parameterNode); //emitParameter
             if (i < len - 1)
             {
                 writeToken(ASEmitterTokens.COMMA);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/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 01a3298..bd7bf15 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
@@ -113,7 +113,7 @@ public class JSEmitter extends ASEmitter implements IJSEmitter
         write(ASEmitterTokens.SPACE);
         write(fnode.getName());
         endMapping(node);
-        emitParameters(fnode.getParameterNodes());
+        emitParameters(fnode.getParametersContainerNode());
         emitFunctionScope(fnode.getScopedNode());
     }
     
@@ -124,7 +124,7 @@ public class JSEmitter extends ASEmitter implements IJSEmitter
         FunctionNode fnode = node.getFunctionNode();
         write(ASEmitterTokens.FUNCTION);
         endMapping(node);
-        emitParameters(fnode.getParameterNodes());
+        emitParameters(fnode.getParametersContainerNode());
         emitFunctionScope(fnode.getScopedNode());
     }
 
@@ -160,14 +160,14 @@ public class JSEmitter extends ASEmitter implements IJSEmitter
         }
     }
 
-    public void emitParameters(IParameterNode[] nodes)
+    public void emitParameters(IContainerNode node)
     {
         write(ASEmitterTokens.PAREN_OPEN);
-        int len = nodes.length;
+        int len = node.getChildCount();
         for (int i = 0; i < len; i++)
         {
-            IParameterNode node = nodes[i];
-            getWalker().walk(node); //emitParameter
+            IParameterNode parameterNode = (IParameterNode) node.getChild(i);
+            getWalker().walk(parameterNode); //emitParameter
             if (i < len - 1)
             {
                 writeToken(ASEmitterTokens.COMMA);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java
index 3f77efc..fe00d82 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java
@@ -186,7 +186,7 @@ public class JSAMDEmitter extends JSEmitter implements IJSAMDEmitter
 
         write("function ");
         write(node.getName());
-        emitParameters(node.getParameterNodes());
+        emitParameters(node.getParametersContainerNode());
         if (!isImplicit((IContainerNode) node.getScopedNode()))
         {
             emitMethodScope(node.getScopedNode());
@@ -604,7 +604,7 @@ public class JSAMDEmitter extends JSEmitter implements IJSAMDEmitter
 
         write(kind + ": function ");
         write(definition.getBaseName() + "$" + kind);
-        emitParameters(fnode.getParameterNodes());
+        emitParameters(fnode.getParametersContainerNode());
         emitMethodScope(fnode.getScopedNode());
     }
 
@@ -626,7 +626,7 @@ public class JSAMDEmitter extends JSEmitter implements IJSAMDEmitter
         write(":");
         write(" function ");
         write(node.getName());
-        emitParameters(node.getParameterNodes());
+        emitParameters(node.getParametersContainerNode());
         emitMethodScope(node.getScopedNode());
     }
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/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 bc48f83..d37e258 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
@@ -334,7 +334,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
                     writeToken(ASEmitterTokens.EQUAL);
                     write(ASEmitterTokens.FUNCTION);
 
-                    emitParameters(((IFunctionNode) mnode).getParameterNodes());
+                    emitParameters(((IFunctionNode) mnode).getParametersContainerNode());
 
                     write(ASEmitterTokens.SPACE);
                     write(ASEmitterTokens.BLOCK_OPEN);
@@ -517,7 +517,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
         writeToken(ASEmitterTokens.EQUAL);
         write(ASEmitterTokens.FUNCTION);
 
-        emitParameters(node.getParameterNodes());
+        emitParameters(node.getParametersContainerNode());
 
         boolean hasSuperClass = EmitterUtils.hasSuperClass(project, node);
 
@@ -1003,7 +1003,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
                 : ASEmitterTokens.SET);
         write(ASEmitterTokens.COLON);
         write(ASEmitterTokens.FUNCTION);
-        emitParameters(node.getParameterNodes());
+        emitParameters(node.getParametersContainerNode());
 
         emitDefinePropertyFunction(node);
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/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 e958fe1..f2910d7 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
@@ -129,7 +129,7 @@ public class AccessorEmitter extends JSSubEmitter implements
                     write(JSDocEmitterTokens.JSDOC_CLOSE);
                     write(ASEmitterTokens.SPACE);
                     write(ASEmitterTokens.FUNCTION);
-                    fjs.emitParameters(p.getter.getParameterNodes());
+                    fjs.emitParameters(p.getter.getParametersContainerNode());
 
                     fjs.emitDefinePropertyFunction(p.getter);
                     wroteGetter = true;
@@ -207,7 +207,7 @@ public class AccessorEmitter extends JSSubEmitter implements
                     write(JSDocEmitterTokens.JSDOC_CLOSE);
                     write(ASEmitterTokens.SPACE);
                     write(ASEmitterTokens.FUNCTION);
-                    fjs.emitParameters(p.setter.getParameterNodes());
+                    fjs.emitParameters(p.setter.getParametersContainerNode());
 
                     fjs.emitDefinePropertyFunction(p.setter);
                 }
@@ -310,7 +310,7 @@ public class AccessorEmitter extends JSSubEmitter implements
                     write(ASEmitterTokens.COLON);
                     write(ASEmitterTokens.SPACE);
                     write(ASEmitterTokens.FUNCTION);
-                    fjs.emitParameters(p.getter.getParameterNodes());
+                    fjs.emitParameters(p.getter.getParametersContainerNode());
 
                     fjs.emitDefinePropertyFunction(p.getter);
                 }
@@ -323,7 +323,7 @@ public class AccessorEmitter extends JSSubEmitter implements
                     write(ASEmitterTokens.COLON);
                     write(ASEmitterTokens.SPACE);
                     write(ASEmitterTokens.FUNCTION);
-                    fjs.emitParameters(p.setter.getParameterNodes());
+                    fjs.emitParameters(p.setter.getParametersContainerNode());
 
                     fjs.emitDefinePropertyFunction(p.setter);
                 }
@@ -412,7 +412,7 @@ public class AccessorEmitter extends JSSubEmitter implements
             writeToken(node.getName());
             writeToken(ASEmitterTokens.EQUAL);
             write(ASEmitterTokens.FUNCTION);
-            fjs.emitParameters(node.getParameterNodes());
+            fjs.emitParameters(node.getParametersContainerNode());
             //writeNewline();
             fjs.emitMethodScope(node.getScopedNode());
         }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java
index d1e69d7..f267cff 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java
@@ -63,7 +63,7 @@ public class DefinePropertyFunctionEmitter extends JSSubEmitter implements
         if (isBindableSetter)
         {
             //write(ASEmitterTokens.FUNCTION);
-            //emitParameters(node.getParameterNodes());
+            //emitParameters(node.getParametersContainerNode());
             write(ASEmitterTokens.SPACE);
             writeNewline(ASEmitterTokens.BLOCK_OPEN);
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java
index a557d78..626896f 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java
@@ -114,7 +114,7 @@ public class InterfaceEmitter extends JSSubEmitter implements
                     write(ASEmitterTokens.FUNCTION);
 
                     fjs.emitParameters(((IFunctionNode) mnode)
-                            .getParameterNodes());
+                            .getParametersContainerNode());
 
                     write(ASEmitterTokens.SPACE);
                     write(ASEmitterTokens.BLOCK_OPEN);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
index e067bda..ee2b499 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
@@ -106,7 +106,7 @@ public class MethodEmitter extends JSSubEmitter implements
         write(ASEmitterTokens.FUNCTION);
         getEmitter().endMapping(node);
 
-        fjs.emitParameters(node.getParameterNodes());
+        fjs.emitParameters(node.getParametersContainerNode());
 
         boolean hasSuperClass = EmitterUtils.hasSuperClass(project, node);
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java
index 2a20f6a..d867332 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java
@@ -93,7 +93,7 @@ public class ObjectDefinePropertyEmitter extends JSSubEmitter implements
             writeToken(node.getName());
             writeToken(ASEmitterTokens.EQUAL);
             write(ASEmitterTokens.FUNCTION);
-            fjs.emitParameters(node.getParameterNodes());
+            fjs.emitParameters(node.getParametersContainerNode());
             //writeNewline();
             fjs.emitMethodScope(node.getScopedNode());
         }
@@ -150,7 +150,7 @@ public class ObjectDefinePropertyEmitter extends JSSubEmitter implements
                 : ASEmitterTokens.SET);
         write(ASEmitterTokens.COLON);
         write(ASEmitterTokens.FUNCTION);
-        fjs.emitParameters(node.getParameterNodes());
+        fjs.emitParameters(node.getParametersContainerNode());
 
         fjs.emitDefinePropertyFunction(node);
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd2f51c6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
index 0eb2a78..13bcbb3 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
@@ -250,7 +250,7 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
             write(ASEmitterTokens.SPACE);
             writeToken(ASEmitterTokens.EQUAL);
             write(ASEmitterTokens.FUNCTION);
-            emitParameters(((IFunctionNode) mnode).getParameterNodes());
+            emitParameters(((IFunctionNode) mnode).getParametersContainerNode());
             write(ASEmitterTokens.SPACE);
             write(ASEmitterTokens.BLOCK_OPEN);
             write(ASEmitterTokens.BLOCK_CLOSE);
@@ -547,7 +547,7 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         writeToken(ASEmitterTokens.EQUAL);
         write(ASEmitterTokens.FUNCTION);
 
-        emitParameters(node.getParameterNodes());
+        emitParameters(node.getParametersContainerNode());
 
         boolean hasSuperClass = hasSuperClass(node);
 
@@ -1472,7 +1472,7 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         writeToken(node.getName());
         writeToken(ASEmitterTokens.EQUAL);
         write(ASEmitterTokens.FUNCTION);
-        emitParameters(node.getParameterNodes());
+        emitParameters(node.getParametersContainerNode());
         //writeNewline();
         emitMethodScope(node.getScopedNode());
     }


Mime
View raw message