flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [6/9] git commit: [flex-falcon] [refs/heads/develop] - Proper emission of parameters of interface members.
Date Fri, 06 Dec 2013 10:37:16 GMT
Proper emission of parameters of interface members.

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: dfa58928feafa07090dc51a6ec059f0824d195b7
Parents: aa15629
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Fri Dec 6 10:56:46 2013 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Fri Dec 6 10:56:46 2013 +0100

----------------------------------------------------------------------
 .../codegen/js/flexjs/JSFlexJSEmitter.java      | 60 +++++++-------------
 1 file changed, 19 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dfa58928/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 712e8c5..947a268 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
@@ -226,52 +226,30 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
             boolean isAccessor = mnode.getNodeID() == ASTNodeID.GetterID
                     || mnode.getNodeID() == ASTNodeID.SetterID;
 
-            if (!isAccessor || !propertyNames.contains(qname))
-            {
-                if (isAccessor && !propertyNames.contains(qname))
-                {
-                    propertyNames.add(qname);
-                }
+            writeNewline();
+            writeNewline();
+            writeNewline();
 
-                if (isAccessor)
-                {
-                    emitInterfaceMember(qname, mnode, true, true);
-                    emitInterfaceMember(qname, mnode, true, false);
-                }
-                else
-                {
-                    emitInterfaceMember(qname, mnode, false, false);
-                }
+            write(qname);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            if (isAccessor)
+            {
+                writeGetSetPrefix(mnode.getNodeID() == ASTNodeID.GetterID);
             }
+            write(mnode.getQualifiedName());
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.FUNCTION);
+            emitParameters(((IFunctionNode) mnode).getParameterNodes());
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
         }
     }
 
-    private void emitInterfaceMember(String qname, IDefinitionNode dnode, 
-            boolean isAccessor, boolean isGetter)
-    {
-        writeNewline();
-        writeNewline();
-        writeNewline();
-
-        write(qname);
-        write(ASEmitterTokens.MEMBER_ACCESS);
-        write(JSEmitterTokens.PROTOTYPE);
-        write(ASEmitterTokens.MEMBER_ACCESS);
-        if (isAccessor)
-        {
-            writeGetSetPrefix(isGetter);
-        }
-        write(dnode.getQualifiedName());
-        write(ASEmitterTokens.SPACE);
-        writeToken(ASEmitterTokens.EQUAL);
-        write(ASEmitterTokens.FUNCTION);
-        emitParameters(((IFunctionNode) dnode).getParameterNodes());
-        write(ASEmitterTokens.SPACE);
-        write(ASEmitterTokens.BLOCK_OPEN);
-        write(ASEmitterTokens.BLOCK_CLOSE);
-        write(ASEmitterTokens.SEMICOLON);
-    }
-    
     @Override
     public void emitField(IVariableNode node)
     {


Mime
View raw message