You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ft...@apache.org on 2015/06/02 14:42:14 UTC

[07/35] git commit: [flex-falcon] [refs/heads/IDEA-FLEX_JS_COMPILER] - - Refactored function calls to FunctionCallEmitter.

- Refactored function calls to FunctionCallEmitter.


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

Branch: refs/heads/IDEA-FLEX_JS_COMPILER
Commit: 62b62ec2f342de90cbacb81af58266fd5b7bc734
Parents: 1b86402
Author: Michael Schmalle <ms...@apache.org>
Authored: Sat May 30 18:07:05 2015 -0400
Committer: Frédéric THOMAS <we...@gmail.com>
Committed: Tue Jun 2 13:40:13 2015 +0100

----------------------------------------------------------------------
 .../compiler/internal/codegen/as/ASEmitter.java |   2 +-
 .../internal/codegen/js/JSSessionModel.java     |  12 +-
 .../internal/codegen/js/JSSubEmitter.java       |   6 +
 .../internal/codegen/js/amd/JSAMDEmitter.java   |   2 +-
 .../codegen/js/flexjs/JSFlexJSEmitter.java      |  90 ++-----------
 .../internal/codegen/js/goog/JSGoogEmitter.java |  20 ++-
 .../codegen/js/jx/FunctionCallEmitter.java      | 125 +++++++++++++++++++
 .../codegen/js/vf2js/JSVF2JSEmitter.java        |  15 +--
 8 files changed, 165 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/62b62ec2/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 423571b..84d1ac5 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
@@ -1144,7 +1144,7 @@ public class ASEmitter implements IASEmitter, IEmitter
         return null;
     }
 
-    protected void walkArguments(IExpressionNode[] nodes)
+    public void walkArguments(IExpressionNode[] nodes)
     {
         int len = nodes.length;
         for (int i = 0; i < len; i++)

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/62b62ec2/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java
index 97cc52b..ba8df11 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java
@@ -32,6 +32,10 @@ import org.apache.flex.compiler.tree.as.ISetterNode;
  */
 public class JSSessionModel
 {
+    public static final String CONSTRUCTOR_EMPTY = "emptyConstructor";
+    public static final String CONSTRUCTOR_FULL = "fullConstructor";
+    public static final String SUPER_FUNCTION_CALL = "replaceSuperFunction";
+
     private IClassDefinition currentClass;
 
     public static class PropertyNodes
@@ -41,9 +45,9 @@ public class JSSessionModel
     }
 
     private HashMap<String, PropertyNodes> propertyMap = new HashMap<String, PropertyNodes>();
-    
+
     private HashMap<String, PropertyNodes> staticPropertyMap = new HashMap<String, PropertyNodes>();
-    
+
     private ArrayList<String> bindableVars = new ArrayList<String>();
 
     public IClassDefinition getCurrentClass()
@@ -60,12 +64,12 @@ public class JSSessionModel
     {
         return propertyMap;
     }
-    
+
     public HashMap<String, PropertyNodes> getStaticPropertyMap()
     {
         return staticPropertyMap;
     }
-    
+
     public boolean hasBindableVars()
     {
         return bindableVars.size() > 0;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/62b62ec2/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
index 00ed207..e4a413f 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
@@ -22,6 +22,7 @@ package org.apache.flex.compiler.internal.codegen.js;
 import org.apache.flex.compiler.codegen.IEmitterTokens;
 import org.apache.flex.compiler.codegen.js.IJSEmitter;
 import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.visitor.IBlockWalker;
 
 public class JSSubEmitter
 {
@@ -32,6 +33,11 @@ public class JSSubEmitter
         return emitter; 
     }
 
+    protected IBlockWalker getWalker()
+    {
+        return emitter.getWalker();
+    }
+    
     protected ICompilerProject getProject()
     {
         return emitter.getWalker().getProject();

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/62b62ec2/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 8dcbb2c..3f77efc 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
@@ -783,7 +783,7 @@ public class JSAMDEmitter extends JSEmitter implements IJSAMDEmitter
     }
 
     @Override
-    protected void walkArguments(IExpressionNode[] nodes)
+    public void walkArguments(IExpressionNode[] nodes)
     {
     }
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/62b62ec2/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 ec5c2db..4f5a57e 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
@@ -30,7 +30,6 @@ import java.util.Set;
 import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
 import org.apache.flex.compiler.clients.MXMLJSC;
 import org.apache.flex.compiler.clients.MXMLJSC.JSOutputType;
-import org.apache.flex.compiler.codegen.IASGlobalFunctionConstants;
 import org.apache.flex.compiler.codegen.IDocEmitter;
 import org.apache.flex.compiler.codegen.js.flexjs.IJSFlexJSEmitter;
 import org.apache.flex.compiler.common.ASModifier;
@@ -45,15 +44,16 @@ import org.apache.flex.compiler.definitions.IPackageDefinition;
 import org.apache.flex.compiler.definitions.ITypeDefinition;
 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.JSSessionModel;
 import org.apache.flex.compiler.internal.codegen.js.JSSessionModel.PropertyNodes;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitter;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.jx.ClassEmitter;
 import org.apache.flex.compiler.internal.codegen.js.jx.FieldEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.FunctionCallEmitter;
 import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
 import org.apache.flex.compiler.internal.definitions.ClassDefinition;
 import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
-import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
 import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
 import org.apache.flex.compiler.internal.definitions.VariableDefinition;
 import org.apache.flex.compiler.internal.projects.CompilerProject;
@@ -113,6 +113,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     
     private ClassEmitter classEmitter;
     private FieldEmitter fieldEmitter;
+    private FunctionCallEmitter functionCallEmitter;
 
     public ClassEmitter getClassEmiter()
     {
@@ -125,6 +126,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 
         classEmitter = new ClassEmitter(this);
         fieldEmitter = new FieldEmitter(this);
+        functionCallEmitter = new FunctionCallEmitter(this);
     }
 
     @Override
@@ -228,83 +230,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     @Override
     public void emitFunctionCall(IFunctionCallNode node)
     {
-        IASNode cnode = node.getChild(0);
-
-        if (cnode.getNodeID() == ASTNodeID.MemberAccessExpressionID)
-            cnode = cnode.getChild(0);
-
-        ASTNodeID id = cnode.getNodeID();
-        if (id != ASTNodeID.SuperID)
-        {
-            ICompilerProject project = null;
-            IDefinition def = null;
-
-            boolean isClassCast = false;
-
-            if (node.isNewExpression())
-            {
-                writeToken(ASEmitterTokens.NEW);
-            }
-            else
-            {
-                if (project == null)
-                    project = getWalker().getProject();
-
-                def = node.getNameNode().resolve(project);
-
-                isClassCast = (def instanceof ClassDefinition || def instanceof InterfaceDefinition)
-                        && !(NativeUtils.isJSNative(def.getBaseName()));
-            }
-
-            if (node.isNewExpression())
-            {
-                if (project == null)
-                    project = getWalker().getProject();
-
-                def = node.resolveCalledExpression(project);
-                // all new calls to a class should be fully qualified names
-                if (def instanceof ClassDefinition)
-                    write(formatQualifiedName(def.getQualifiedName()));
-                else
-                    // I think we still need this for "new someVarOfTypeClass"
-                    getWalker().walk(node.getNameNode());
-                write(ASEmitterTokens.PAREN_OPEN);
-                walkArguments(node.getArgumentNodes());
-                write(ASEmitterTokens.PAREN_CLOSE);
-            }
-            else if (!isClassCast)
-            {
-                if (def != null)
-                {
-                    boolean isInt = def.getBaseName().equals(
-                            IASGlobalFunctionConstants._int);
-                    if (isInt
-                            || def.getBaseName().equals(
-                                    IASGlobalFunctionConstants.trace)
-                            || def.getBaseName().equals(
-                                    IASGlobalFunctionConstants.uint))
-                    {
-                        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
-                        write(ASEmitterTokens.MEMBER_ACCESS);
-                        if (isInt)
-                            write(JSFlexJSEmitterTokens.UNDERSCORE);
-                    }
-                }
-                getWalker().walk(node.getNameNode());
-                write(ASEmitterTokens.PAREN_OPEN);
-                walkArguments(node.getArgumentNodes());
-                write(ASEmitterTokens.PAREN_CLOSE);
-            }
-            else
-            {
-                emitIsAs(node.getArgumentNodes()[0], node.getNameNode(),
-                        ASTNodeID.Op_AsID, true);
-            }
-        }
-        else
-        {
-            emitSuperCall(node, SUPER_FUNCTION_CALL);
-        }
+        functionCallEmitter.emit(node);
     }
 
     //--------------------------------------------------------------------------
@@ -524,7 +450,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     //--------------------------------------------------------------------------
 
     @Override
-    protected void emitSuperCall(IASNode node, String type)
+    public void emitSuperCall(IASNode node, String type)
     {
         IFunctionNode fnode = (node instanceof IFunctionNode) ? (IFunctionNode) node
                 : null;
@@ -533,7 +459,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
 
         final IClassDefinition thisClass = getModel().getCurrentClass();
 
-        if (type == SUPER_FUNCTION_CALL)
+        if (type == JSSessionModel.SUPER_FUNCTION_CALL)
         {
             if (fnode == null)
                 fnode = (IFunctionNode) fcnode
@@ -772,7 +698,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
         }
     }
 
-    private void emitIsAs(IExpressionNode left, IExpressionNode right,
+    public void emitIsAs(IExpressionNode left, IExpressionNode right,
             ASTNodeID id, boolean coercion)
     {
         // project is null in unit tests

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/62b62ec2/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 db88672..530a381 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
@@ -40,6 +40,7 @@ import org.apache.flex.compiler.definitions.ITypeDefinition;
 import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.JSEmitter;
 import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
 import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
 import org.apache.flex.compiler.internal.definitions.ClassDefinition;
 import org.apache.flex.compiler.internal.scopes.PackageScope;
@@ -82,11 +83,6 @@ import org.apache.flex.compiler.utils.ASNodeUtils;
  */
 public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
 {
-
-    protected static final String CONSTRUCTOR_EMPTY = "emptyConstructor";
-    protected static final String CONSTRUCTOR_FULL = "fullConstructor";
-    protected static final String SUPER_FUNCTION_CALL = "replaceSuperFunction";
-
     protected List<String> propertyNames = new ArrayList<String>();
 
     public ICompilerProject project;
@@ -490,7 +486,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
             write(ASEmitterTokens.SPACE);
             write(ASEmitterTokens.BLOCK_OPEN);
             if (hasSuperClass)
-                emitSuperCall(node, CONSTRUCTOR_EMPTY);
+                emitSuperCall(node, JSSessionModel.CONSTRUCTOR_EMPTY);
             writeNewline();
             write(ASEmitterTokens.BLOCK_CLOSE);
         }
@@ -536,7 +532,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
         }
         else
         {
-            emitSuperCall(node, SUPER_FUNCTION_CALL);
+            emitSuperCall(node, JSSessionModel.SUPER_FUNCTION_CALL);
         }
     }
 
@@ -624,7 +620,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
 
         if (node.isConstructor() && hasSuperClass(node)
                 && !hasSuperCall(node.getScopedNode()))
-            emitSuperCall(node, CONSTRUCTOR_FULL);
+            emitSuperCall(node, JSSessionModel.CONSTRUCTOR_FULL);
 
         emitRestParameterCodeBlock(node);
 
@@ -647,13 +643,13 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
         IFunctionCallNode fcnode = (node instanceof IFunctionCallNode) ? (FunctionCallNode) node
                 : null;
 
-        if (type == CONSTRUCTOR_EMPTY)
+        if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
         {
             indentPush();
             writeNewline();
             indentPop();
         }
-        else if (type == SUPER_FUNCTION_CALL)
+        else if (type == JSSessionModel.SUPER_FUNCTION_CALL)
         {
             if (fnode == null)
                 fnode = (IFunctionNode) fcnode
@@ -722,12 +718,12 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
 
         write(ASEmitterTokens.PAREN_CLOSE);
 
-        if (type == CONSTRUCTOR_FULL)
+        if (type == JSSessionModel.CONSTRUCTOR_FULL)
         {
             write(ASEmitterTokens.SEMICOLON);
             writeNewline();
         }
-        else if (type == CONSTRUCTOR_EMPTY)
+        else if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
         {
             write(ASEmitterTokens.SEMICOLON);
         }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/62b62ec2/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
new file mode 100644
index 0000000..00bdf18
--- /dev/null
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
@@ -0,0 +1,125 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.IASGlobalFunctionConstants;
+import org.apache.flex.compiler.codegen.ISubEmitter;
+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.JSSessionModel;
+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.ClassDefinition;
+import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.utils.NativeUtils;
+
+public class FunctionCallEmitter extends JSSubEmitter implements
+        ISubEmitter<IFunctionCallNode>
+{
+
+    public FunctionCallEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IFunctionCallNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        IASNode cnode = node.getChild(0);
+
+        if (cnode.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+            cnode = cnode.getChild(0);
+
+        ASTNodeID id = cnode.getNodeID();
+        if (id != ASTNodeID.SuperID)
+        {
+            IDefinition def = null;
+
+            boolean isClassCast = false;
+
+            if (node.isNewExpression())
+            {
+                writeToken(ASEmitterTokens.NEW);
+            }
+            else
+            {
+                def = node.getNameNode().resolve(getProject());
+
+                isClassCast = (def instanceof ClassDefinition || def instanceof InterfaceDefinition)
+                        && !(NativeUtils.isJSNative(def.getBaseName()));
+            }
+
+            if (node.isNewExpression())
+            {
+                def = node.resolveCalledExpression(getProject());
+                // all new calls to a class should be fully qualified names
+                if (def instanceof ClassDefinition)
+                    write(fjs.formatQualifiedName(def.getQualifiedName()));
+                else
+                    // I think we still need this for "new someVarOfTypeClass"
+                    fjs.getWalker().walk(node.getNameNode());
+                write(ASEmitterTokens.PAREN_OPEN);
+                fjs.walkArguments(node.getArgumentNodes());
+                write(ASEmitterTokens.PAREN_CLOSE);
+            }
+            else if (!isClassCast)
+            {
+                if (def != null)
+                {
+                    boolean isInt = def.getBaseName().equals(
+                            IASGlobalFunctionConstants._int);
+                    if (isInt
+                            || def.getBaseName().equals(
+                                    IASGlobalFunctionConstants.trace)
+                            || def.getBaseName().equals(
+                                    IASGlobalFunctionConstants.uint))
+                    {
+                        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                        write(ASEmitterTokens.MEMBER_ACCESS);
+                        if (isInt)
+                            write(JSFlexJSEmitterTokens.UNDERSCORE);
+                    }
+                }
+                getWalker().walk(node.getNameNode());
+                write(ASEmitterTokens.PAREN_OPEN);
+                fjs.walkArguments(node.getArgumentNodes());
+                write(ASEmitterTokens.PAREN_CLOSE);
+            }
+            else
+            {
+                fjs.emitIsAs(node.getArgumentNodes()[0], node.getNameNode(),
+                        ASTNodeID.Op_AsID, true);
+            }
+        }
+        else
+        {
+            fjs.emitSuperCall(node, JSSessionModel.SUPER_FUNCTION_CALL);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/62b62ec2/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 033215a..b11193b 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
@@ -44,6 +44,7 @@ import org.apache.flex.compiler.definitions.IParameterDefinition;
 import org.apache.flex.compiler.definitions.ITypeDefinition;
 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.JSSessionModel;
 import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitter;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
@@ -281,7 +282,7 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         
         if (node.isConstructor()
                 && hasSuperClass(node) && !hasSuperCall(node.getScopedNode()))
-            emitSuperCall(node, CONSTRUCTOR_FULL);
+            emitSuperCall(node, JSSessionModel.CONSTRUCTOR_FULL);
     }
 
     private void emitVarNonLiteralAssignments()
@@ -542,7 +543,7 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
             emitVarNonLiteralAssignments();
             if (hasSuperClass)
             {
-                emitSuperCall(node, CONSTRUCTOR_EMPTY);
+                emitSuperCall(node, JSSessionModel.CONSTRUCTOR_EMPTY);
                 writeNewline();
             }
             write(ASEmitterTokens.BLOCK_CLOSE);
@@ -669,7 +670,7 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         }
         else
         {
-            emitSuperCall(node, SUPER_FUNCTION_CALL);
+            emitSuperCall(node, JSSessionModel.SUPER_FUNCTION_CALL);
         }
     }
 
@@ -1002,13 +1003,13 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         IFunctionCallNode fcnode = (node instanceof IFunctionCallNode) ? (FunctionCallNode) node
                 : null;
 
-        if (type == CONSTRUCTOR_EMPTY)
+        if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
         {
             indentPush();
             writeNewline();
             indentPop();
         }
-        else if (type == SUPER_FUNCTION_CALL)
+        else if (type == JSSessionModel.SUPER_FUNCTION_CALL)
         {
             if (fnode == null)
                 fnode = (IFunctionNode) fcnode
@@ -1141,12 +1142,12 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
 
         write(ASEmitterTokens.PAREN_CLOSE);
 
-        if (type == CONSTRUCTOR_FULL)
+        if (type == JSSessionModel.CONSTRUCTOR_FULL)
         {
             write(ASEmitterTokens.SEMICOLON);
             writeNewline();
         }
-        else if (type == CONSTRUCTOR_EMPTY)
+        else if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
         {
             write(ASEmitterTokens.SEMICOLON);
         }