You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2014/10/31 17:50:42 UTC

[08/14] git commit: [flex-falcon] [refs/heads/develop] - A bit of trickery to get some SDK classes to behave

A bit of trickery to get some SDK classes to behave

In order for the JS Flex SDK initialization to run, these three classes need to 'be' of type Class ...

Signed-off-by: Erik de Bruin <er...@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/5e47b16d
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/5e47b16d
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/5e47b16d

Branch: refs/heads/develop
Commit: 5e47b16da5b5322f606aac80215bad6419a00ea6
Parents: bfe8034
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:32:32 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:03 2014 +0100

----------------------------------------------------------------------
 .../codegen/js/vf2js/JSVF2JSEmitter.java        | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5e47b16d/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 5b230e1..5947783 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
@@ -472,10 +472,40 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
             writeToken(ASEmitterTokens.COMMA);
             String sname = getSuperClassDefinition(node, project)
                     .getQualifiedName();
+            if (sname.equals(IASLanguageConstants.Object))
+            	sname = IASLanguageConstants.Class;
             write(sname);
             write(ASEmitterTokens.PAREN_CLOSE);
         }
     }
+    
+    @Override
+    protected boolean hasSuperClass(IDefinitionNode node)
+    {
+        ICompilerProject project = getWalker().getProject();
+        IClassDefinition superClassDefinition = getSuperClassDefinition(node,
+                project);
+        
+        if (superClassDefinition == null)
+            return false;
+        
+        String qname = superClassDefinition.getQualifiedName();
+
+        // ToDo (erikdebruin): need this to get the JS version of the SDK in 
+        //                     shape?
+        boolean useClassAsSuperClass = !qname.equals(IASLanguageConstants.Object);
+        if (!useClassAsSuperClass)
+        {
+        	if (node.getQualifiedName().equals("mx.core.EmbeddedFontRegistry") ||
+    			node.getQualifiedName().equals("mx.managers.HistoryManagerImpl") ||
+    			node.getQualifiedName().equals("mx.core.TextFieldFactory"))
+        	{
+        		useClassAsSuperClass = true;
+        	}
+        }
+        
+        return superClassDefinition != null && useClassAsSuperClass;
+    }
 
     @Override
     public void emitFunctionCall(IFunctionCallNode node)