flex-commits mailing list archives

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

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/53eb5618
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/53eb5618
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/53eb5618

Branch: refs/heads/develop
Commit: 53eb5618a240c4724b7879d2b07c87d278b9a9a7
Parents: e3eff8e
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Fri Dec 6 10:12:54 2013 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Fri Dec 6 10:12:54 2013 +0100

----------------------------------------------------------------------
 .../codegen/js/flexjs/JSFlexJSEmitter.java      | 55 ++++++++++++--------
 1 file changed, 33 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/53eb5618/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 cd67c00..712e8c5 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
@@ -220,7 +220,6 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         }
 
         
-        /* (aharui): is there any reason to emit members at all?
         final IDefinitionNode[] members = node.getAllMemberDefinitionNodes();
         for (IDefinitionNode mnode : members)
         {
@@ -229,38 +228,50 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 
             if (!isAccessor || !propertyNames.contains(qname))
             {
-                writeNewline();
-
-                write(qname);
-                write(ASEmitterTokens.MEMBER_ACCESS);
-                write(JSEmitterTokens.PROTOTYPE);
-                write(ASEmitterTokens.MEMBER_ACCESS);
-                write(mnode.getQualifiedName());
-
                 if (isAccessor && !propertyNames.contains(qname))
                 {
                     propertyNames.add(qname);
                 }
+
+                if (isAccessor)
+                {
+                    emitInterfaceMember(qname, mnode, true, true);
+                    emitInterfaceMember(qname, mnode, true, false);
+                }
                 else
                 {
-                    write(ASEmitterTokens.SPACE);
-                    writeToken(ASEmitterTokens.EQUAL);
-                    write(ASEmitterTokens.FUNCTION);
-
-                    emitParameters(((IFunctionNode) mnode).getParameterNodes());
-
-                    write(ASEmitterTokens.SPACE);
-                    write(ASEmitterTokens.BLOCK_OPEN);
-                    writeNewline();
-                    write(ASEmitterTokens.BLOCK_CLOSE);
+                    emitInterfaceMember(qname, mnode, false, false);
                 }
-
-                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