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:35 UTC

[01/14] git commit: [flex-falcon] [refs/heads/develop] - In JS, initial property (non-literal) value assignments must take place in the constructor, not on the property definition itself

Repository: flex-falcon
Updated Branches:
  refs/heads/develop f05424470 -> bd111dd43


In JS, initial property (non-literal) value assignments must take place in the constructor, not on the property definition itself

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

Branch: refs/heads/develop
Commit: af39216ad987f80d16888b3f77929c504b15a084
Parents: 0734ae4
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:36:56 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:03 2014 +0100

----------------------------------------------------------------------
 .../codegen/js/vf2js/JSVF2JSEmitter.java        | 83 +++++++++++++++++++-
 1 file changed, 80 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/af39216a/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 1ff495c..939b2bf 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
@@ -33,12 +33,14 @@ import org.apache.flex.compiler.codegen.IDocEmitter;
 import org.apache.flex.compiler.codegen.js.vf2js.IJSVF2JSEmitter;
 import org.apache.flex.compiler.common.ASModifier;
 import org.apache.flex.compiler.common.ModifiersSet;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
 import org.apache.flex.compiler.definitions.IClassDefinition;
 import org.apache.flex.compiler.definitions.IDefinition;
 import org.apache.flex.compiler.definitions.IFunctionDefinition;
 import org.apache.flex.compiler.definitions.IFunctionDefinition.FunctionClassification;
 import org.apache.flex.compiler.definitions.INamespaceDefinition;
 import org.apache.flex.compiler.definitions.IPackageDefinition;
+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;
@@ -71,6 +73,7 @@ import org.apache.flex.compiler.tree.as.IASNode;
 import org.apache.flex.compiler.tree.as.IAccessorNode;
 import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
 import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
 import org.apache.flex.compiler.tree.as.IDefinitionNode;
 import org.apache.flex.compiler.tree.as.IEmbedNode;
 import org.apache.flex.compiler.tree.as.IExpressionNode;
@@ -80,6 +83,7 @@ import org.apache.flex.compiler.tree.as.IFunctionNode;
 import org.apache.flex.compiler.tree.as.IGetterNode;
 import org.apache.flex.compiler.tree.as.IIdentifierNode;
 import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IKeywordNode;
 import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
 import org.apache.flex.compiler.tree.as.ILiteralNode;
 import org.apache.flex.compiler.tree.as.ILiteralNode.LiteralType;
@@ -256,11 +260,81 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
     }
 
     @Override
+    public void emitFunctionBlockHeader(IFunctionNode node)
+    {
+        IDefinition def = node.getDefinition();
+        boolean isStatic = false;
+        if (def != null && def.isStatic())
+            isStatic = true;
+        boolean isLocal = false;
+        if (node.getFunctionClassification() == IFunctionDefinition.FunctionClassification.LOCAL)
+            isLocal = true;
+        if (hasBody(node) && !isStatic && !isLocal)
+            emitSelfReference(node);
+
+        emitRestParameterCodeBlock(node);
+
+        emitDefaultParameterCodeBlock(node);
+
+        if (node.isConstructor())
+        {
+        	emitVarNonLiteralAssignments();
+        }
+        
+        if (node.isConstructor()
+                && hasSuperClass(node) && !hasSuperCall(node.getScopedNode()))
+            emitSuperCall(node, CONSTRUCTOR_FULL);
+    }
+
+    private void emitVarNonLiteralAssignments()
+    {
+        // (erikdebruin): If the initial value of a variable is set using
+        //                a method, JS needs this initialization to be done
+        //                in the constructor
+    	IClassNode cdnode = (IClassNode) thisClass.getNode();
+        IDefinitionNode[] dnodes = cdnode.getAllMemberNodes();
+        for (IDefinitionNode dnode : dnodes)
+        {
+            if (dnode.getNodeID() == ASTNodeID.VariableID)
+            {
+            	IVariableNode vnode = (IVariableNode) dnode;
+            	IExpressionNode avnode = vnode.getAssignedValueNode();
+                if (avnode != null && 
+            		!(avnode instanceof ILiteralNode) && 
+            		!(avnode instanceof IEmbedNode))
+                {
+                	writeNewline("", true);
+                	if (vnode.hasModifier(ASModifier.STATIC))
+                	{
+                		write(cdnode.getQualifiedName());
+                	}
+                	else
+                	{
+                		write(ASEmitterTokens.THIS);
+                	}
+                	write(ASEmitterTokens.MEMBER_ACCESS);
+                	writeToken(vnode.getName());
+                	writeToken(ASEmitterTokens.EQUAL);
+                	getWalker().walk(avnode);
+                	indentPop();
+                	writeNewline(ASEmitterTokens.SEMICOLON);
+                }
+            }
+        }
+    }
+    
+    @Override
     public void emitVarDeclaration(IVariableNode node)
     {
         if (!(node instanceof ChainedVariableNode))
         {
-            emitMemberKeyword(node);
+        	// (erikdebruin): check for 'var i:int = 0, j:int = 0' containers
+        	IASNode pnode = node.getParent();
+        	if (!(pnode instanceof IVariableExpressionNode) || 
+        			node.getChild(0) instanceof IKeywordNode)
+        	{
+        		emitMemberKeyword(node);
+        	}
         }
 
         IExpressionNode avnode = node.getAssignedValueNode();
@@ -332,7 +406,7 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
                 + node.getName());
 
         IExpressionNode vnode = node.getAssignedValueNode();
-        if (vnode != null && !(vnode instanceof IEmbedNode))
+        if (vnode != null && vnode instanceof ILiteralNode)
         {
             write(ASEmitterTokens.SPACE);
             writeToken(ASEmitterTokens.EQUAL);
@@ -454,9 +528,12 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         {
             write(ASEmitterTokens.SPACE);
             write(ASEmitterTokens.BLOCK_OPEN);
+            emitVarNonLiteralAssignments();
             if (hasSuperClass)
+            {
                 emitSuperCall(node, CONSTRUCTOR_EMPTY);
-            writeNewline();
+                writeNewline();
+            }
             write(ASEmitterTokens.BLOCK_CLOSE);
         }
 


[12/14] git commit: [flex-falcon] [refs/heads/develop] - Added VF2JS SWC backend

Posted by er...@apache.org.
Added VF2JS SWC backend

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

Branch: refs/heads/develop
Commit: 2b12a201c830941b1277901615079bb61232afd0
Parents: 667f93e
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:43:19 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:04 2014 +0100

----------------------------------------------------------------------
 .../driver/mxml/vf2js/MXMLVF2JSSWCBackend.java  | 121 +++++++++++++++++++
 1 file changed, 121 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2b12a201/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSSWCBackend.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSSWCBackend.java b/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSSWCBackend.java
new file mode 100644
index 0000000..f9390fc
--- /dev/null
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSSWCBackend.java
@@ -0,0 +1,121 @@
+/*
+ *
+ *  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.driver.mxml.vf2js;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.vf2js.MXMLVF2JSEmitter;
+import org.apache.flex.compiler.internal.driver.js.vf2js.JSVF2JSConfiguration;
+import org.apache.flex.compiler.internal.driver.mxml.MXMLBackend;
+import org.apache.flex.compiler.internal.targets.FlexJSSWCTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLVF2JSSWCBackend extends MXMLBackend
+{
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSVF2JSConfiguration.class);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLVF2JSEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        MXMLBlockWalker walker = new MXMLFlexJSBlockWalker(errors, project,
+                mxmlEmitter, asEmitter, asBlockWalker);
+
+        ASNodeSwitch asStrategy = new ASNodeSwitch(
+                (IBlockVisitor) asBlockWalker);
+        walker.setASStrategy(asStrategy);
+
+        MXMLNodeSwitch mxmlStrategy = new MXMLNodeSwitch(walker);
+        walker.setMXMLStrategy(mxmlStrategy);
+
+        return walker;
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSVF2JSDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSVF2JSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+    
+    @Override
+    public IJSWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new MXMLWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSSWCTarget(project, settings, monitor);
+    }
+}


[13/14] git commit: [flex-falcon] [refs/heads/develop] - Use VF2JS emitter

Posted by er...@apache.org.
Use VF2JS emitter

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

Branch: refs/heads/develop
Commit: b6029558a8a93f03edfa53fba26b8b8c857690a8
Parents: 5bbf200
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:38:04 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:04 2014 +0100

----------------------------------------------------------------------
 .../compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b6029558/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
index b998545..4d1205d 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
@@ -43,7 +43,6 @@ import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase;
 import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase.WatcherType;
 import org.apache.flex.compiler.internal.codegen.databinding.XMLWatcherInfo;
 import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
-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.codegen.js.goog.JSGoogEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSEmitter;
@@ -223,7 +222,7 @@ public class MXMLVF2JSEmitter extends MXMLEmitter implements
         IClassDefinition cdef = node.getContainedClassDefinition();
         IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
                 .getASEmitter();
-        ((JSFlexJSEmitter) asEmitter).thisClass = cdef;
+        ((JSVF2JSEmitter) asEmitter).thisClass = cdef;
 
         IASNode classNode = node.getContainedClassDefinitionNode();
         // visit tags


[04/14] git commit: [flex-falcon] [refs/heads/develop] - VF2JS no longer needs to run on a modified temp project

Posted by er...@apache.org.
VF2JS no longer needs to run on a modified temp project

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

Branch: refs/heads/develop
Commit: 11d72ec279baa71c93fa2164790e607123943acb
Parents: dfdadcb
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:14:13 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:03 2014 +0100

----------------------------------------------------------------------
 .../org/apache/flex/compiler/clients/MXMLJSC.java    | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/11d72ec2/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java b/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
index 81f7f0d..e08cd6c 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
@@ -77,7 +77,6 @@ import org.apache.flex.compiler.targets.ITarget;
 import org.apache.flex.compiler.targets.ITarget.TargetType;
 import org.apache.flex.compiler.targets.ITargetSettings;
 import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.compiler.utils.VF2JSProjectUtils;
 import org.apache.flex.utils.FileUtils;
 import org.apache.flex.utils.FilenameNormalization;
 
@@ -277,13 +276,13 @@ public class MXMLJSC
                                     getTargetType().getExtension());
                 }
 
-                String projectFilePath = adjustedArgs[adjustedArgs.length - 1];
-
-                String newProjectFilePath = VF2JSProjectUtils
-                        .createTempProject(projectFilePath,
-                                isFlashBuilderProject);
-                
-                adjustedArgs[adjustedArgs.length - 1] = newProjectFilePath;
+                //String projectFilePath = adjustedArgs[adjustedArgs.length - 1];
+                //
+                //String newProjectFilePath = VF2JSProjectUtils
+                //        .createTempProject(projectFilePath,
+                //                isFlashBuilderProject);
+                //
+                //adjustedArgs[adjustedArgs.length - 1] = newProjectFilePath;
                 
                 break;
             default:


[06/14] git commit: [flex-falcon] [refs/heads/develop] - Raise visibility to allow overrides

Posted by er...@apache.org.
Raise visibility to allow overrides

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

Branch: refs/heads/develop
Commit: bfe8034cef3d6127fb57b80b132a6b21eb7be878
Parents: 9e5c117
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:21:06 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:03 2014 +0100

----------------------------------------------------------------------
 .../flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java | 2 +-
 .../flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bfe8034c/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
index b2f8761..242cc4e 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
@@ -399,7 +399,7 @@ public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
         emitJSDocLine(name, "");
     }
 
-    private void emitJSDocLine(IEmitterTokens name, String type)
+    protected void emitJSDocLine(IEmitterTokens name, String type)
     {
         emitJSDocLine(name.getToken(), type, "");
     }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bfe8034c/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 d801c22..7050999 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
@@ -785,7 +785,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
         }
     }
 
-    private void emitRestParameterCodeBlock(IFunctionNode node)
+    protected void emitRestParameterCodeBlock(IFunctionNode node)
     {
         IParameterNode[] pnodes = node.getParameterNodes();
 
@@ -957,7 +957,7 @@ public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
                 && !qname.equals(IASLanguageConstants.Object);
     }
 
-    private boolean hasSuperCall(IScopedNode node)
+    protected boolean hasSuperCall(IScopedNode node)
     {
         for (int i = node.getChildCount() - 1; i > -1; i--)
         {


[03/14] git commit: [flex-falcon] [refs/heads/develop] - Added VF2JS MXML backend

Posted by er...@apache.org.
Added VF2JS MXML backend

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

Branch: refs/heads/develop
Commit: dfdadcbe8d5922f053ec296dce81957fddf36d51
Parents: f054244
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:11:13 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:03 2014 +0100

----------------------------------------------------------------------
 .../src/org/apache/flex/compiler/clients/COMPJSC.java       | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dfdadcbe/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
index afc327d..54a7897 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
@@ -42,6 +42,7 @@ import org.apache.flex.compiler.internal.driver.as.ASBackend;
 import org.apache.flex.compiler.internal.driver.js.amd.AMDBackend;
 import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
 import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSSWCBackend;
+import org.apache.flex.compiler.internal.driver.mxml.vf2js.MXMLVF2JSSWCBackend;
 import org.apache.flex.compiler.internal.projects.CompilerProject;
 import org.apache.flex.compiler.internal.targets.JSTarget;
 import org.apache.flex.compiler.problems.ICompilerProblem;
@@ -111,10 +112,12 @@ public class COMPJSC extends MXMLJSC
                     break;
 
                 case VF2JS:
+                    backend = new MXMLVF2JSSWCBackend();
+                    break;
+                    
+                default :
                     throw new NotImplementedException();
-                 }
-
-                break;
+                }
             }
         }
 


[09/14] git commit: [flex-falcon] [refs/heads/develop] - Preliminary addition of VF2JS publishing classes

Posted by er...@apache.org.
Preliminary addition of VF2JS publishing classes

Right now, they're plain copies. I need to rewrite the dependency handling in order to get the GCC to accept the VF2JS application JS.

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

Branch: refs/heads/develop
Commit: 667f93e7db9ba508dddf432ab3f0b64d6184d2db
Parents: 5eee1b1
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:42:41 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:04 2014 +0100

----------------------------------------------------------------------
 .../internal/graph/VF2JSDepsWriter.java         | 403 +++++++++++++++++++
 .../utils/VF2JSClosureCompilerWrapper.java      | 226 +++++++++++
 2 files changed, 629 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/667f93e7/compiler.jx/src/org/apache/flex/compiler/internal/graph/VF2JSDepsWriter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/graph/VF2JSDepsWriter.java b/compiler.jx/src/org/apache/flex/compiler/internal/graph/VF2JSDepsWriter.java
new file mode 100644
index 0000000..82251e7
--- /dev/null
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/graph/VF2JSDepsWriter.java
@@ -0,0 +1,403 @@
+/*
+ *
+ *  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.graph;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Scanner;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.problems.FileNotFoundProblem;
+
+import com.google.common.io.Files;
+
+public class VF2JSDepsWriter {
+
+	public VF2JSDepsWriter(File outputFolder, String mainClassName, JSGoogConfiguration config)
+	{
+		this.outputFolderPath = outputFolder.getAbsolutePath();
+		this.mainName = mainClassName;
+		otherPaths = config.getSDKJSLib();
+	}
+	
+	private ProblemQuery problems;
+	private String outputFolderPath;
+	private String mainName;
+	private List<String> otherPaths;
+	private boolean problemsFound = false;
+	
+	private HashMap<String,GoogDep> depMap = new HashMap<String,GoogDep>();
+	
+	public ArrayList<String> getListOfFiles() throws InterruptedException
+	{
+		buildDB();
+		ArrayList<GoogDep> dps = sort(mainName);
+		ArrayList<String> files = new ArrayList<String>();
+		for (GoogDep gd : dps)
+		{
+			files.add(gd.filePath);
+		}
+		return files;
+	}
+	
+	public boolean generateDeps(ProblemQuery problems, StringBuilder depsFileData) throws InterruptedException, FileNotFoundException
+	{
+	    problemsFound = false;
+	    this.problems = problems;
+		buildDB();
+		ArrayList<GoogDep> dps = sort(mainName);
+		String outString = "// generated by FalconJS" + "\n";
+		int n = dps.size();
+		for (int i = n - 1; i >= 0; i--)
+		{
+			GoogDep gd = dps.get(i);
+			if (!isGoogClass(gd.className)) 
+			{
+			    String s = "goog.addDependency('";
+	            s += relativePath(gd.filePath);
+	            s += "', ['";
+	            s += gd.className;
+	            s += "'], [";
+	            s += getDependencies(gd.deps);
+	            s += "]);\n";
+	            outString += s;
+			}
+		}
+		depsFileData.append(outString);
+		return !problemsFound; 
+	}
+	
+	private boolean isGoogClass(String className)
+	{
+	    return className.startsWith("goog.");
+	}
+	
+	private void buildDB()
+	{
+		addDeps(mainName);
+	}
+	
+    public ArrayList<String> filePathsInOrder = new ArrayList<String>();
+    
+    public ArrayList<String> additionalHTML = new ArrayList<String>();
+    
+    private HashMap<String, GoogDep> visited = new HashMap<String, GoogDep>();
+    
+	private ArrayList<GoogDep> sort(String rootClassName)
+	{
+		ArrayList<GoogDep> arr = new ArrayList<GoogDep>();
+		GoogDep current = depMap.get(rootClassName);
+		sortFunction(current, arr);
+		return arr;
+	}
+	
+	private void sortFunction(GoogDep current, ArrayList<GoogDep> arr)
+	{
+		visited.put(current.className, current);
+		
+		filePathsInOrder.add(current.filePath);
+        System.out.println("Dependencies calculated for '" + current.filePath + "'");
+
+		ArrayList<String> deps = current.deps;
+		for (String className : deps)
+		{
+			if (!visited.containsKey(className) && !isGoogClass(className))
+			{
+				GoogDep gd = depMap.get(className);
+				sortFunction(gd, arr);
+			}
+		}
+		arr.add(current);
+	}
+	
+	private void addDeps(String className)
+	{
+		if (depMap.containsKey(className) || isGoogClass(className))
+			return;
+		
+		// build goog dependency list
+		GoogDep gd = new GoogDep();
+		gd.className = className;
+		gd.filePath = getFilePath(className);
+		depMap.put(gd.className, gd);
+		ArrayList<String> deps = getDirectDependencies(gd.filePath);
+		
+		gd.deps = new ArrayList<String>();
+		ArrayList<String> circulars = new ArrayList<String>();
+		for (String dep : deps)
+		{
+		    if (depMap.containsKey(dep) && !isGoogClass(dep))
+		    {
+		        circulars.add(dep);
+		        continue;
+		    }
+			gd.deps.add(dep);
+		}
+        for (String dep : deps)
+        {
+            addDeps(dep);
+        }
+		if (circulars.size() > 0)
+		{
+		    // remove requires that would cause circularity
+		    try
+            {
+                List<String> fileLines = Files.readLines(new File(gd.filePath), Charset.defaultCharset());
+                ArrayList<String> finalLines = new ArrayList<String>();
+                
+                String inherits = getBaseClass(fileLines, className);
+                
+                for (String line : fileLines)
+                {
+                    int c = line.indexOf("goog.require");
+                    if (c > -1)
+                    {
+                        int c2 = line.indexOf(")");
+                        String s = line.substring(c + 14, c2 - 1);
+                        if (circulars.contains(s) && !s.equals(inherits))
+                            continue;
+                    }
+                    finalLines.add(line);
+                }
+                File file = new File(gd.filePath);  
+                PrintWriter out = new PrintWriter(new FileWriter(file));  
+                for (String s : finalLines)
+                {
+                    out.println(s);
+                }
+                out.close();
+                    
+            }
+            catch (IOException e)
+            {
+                e.printStackTrace();
+            }
+		    
+		}
+	}
+	
+	String getBaseClass(List<String> lines, String className)
+	{
+	    int n = lines.size();
+	    for (int i = 0; i < n; i++)
+	    {
+	        String line = lines.get(i);
+	        int c2;
+	        int c = line.indexOf("goog.inherits");
+	        if (c > -1)
+	        {
+	            String inheritLine = ""; 
+                while (true)
+                {
+                    inheritLine += line;
+                    c2 = line.indexOf(")");
+                    if (c2 > -1)
+                        break;
+                    else
+                    {
+                        i++;
+                        line = lines.get(i);
+                    }
+                }
+	            c = inheritLine.indexOf(",");
+                c2 = inheritLine.indexOf(")");
+                return inheritLine.substring(c + 1, c2).trim();            
+	        }
+	    }
+	    return null;
+	}
+	
+	String getFilePath(String className)
+	{
+	    String fn;
+	    File destFile;
+	    File f;
+	    
+		String classPath = className.replace(".", File.separator);
+		
+        fn = outputFolderPath + File.separator + classPath + ".js";
+        f = new File(fn);
+        if (f.exists())
+        {
+            return fn;
+        }
+        
+        for (String otherPath : otherPaths)
+        {
+    		fn = otherPath + File.separator + classPath + ".js";
+    		f = new File(fn);
+    		if (f.exists())
+    		{
+    			fn = outputFolderPath + File.separator + classPath + ".js";
+    			destFile = new File(fn);
+    			// copy source to output
+    			try {
+    				FileUtils.copyFile(f, destFile);
+    				
+    				// (erikdebruin) copy class assets files
+    				if (className.indexOf("org.apache.flex") > -1)
+    				{
+    				    File assetsDir = new File(f.getParentFile(), "assets");
+    				    if (assetsDir.exists())
+    				    {
+    				        String nameOfClass = className.substring(className.lastIndexOf('.') + 1);
+    				        
+    				        File[] assetsList = assetsDir.listFiles();
+    				        for (int i = 0; i < assetsList.length; i++) 
+    				        {
+    				            File assetFile = assetsList[i];
+    				            String assetFileName = assetFile.getName();
+    				            
+    				            if (assetFile.isFile() && assetFileName.indexOf(nameOfClass) == 0) 
+    				            {
+    				                String pathOfClass = "";
+    				                pathOfClass = className.substring(0, className.lastIndexOf('.'));
+    				                pathOfClass = pathOfClass.replace(".", File.separator);
+    				                
+                                    destFile = new File(outputFolderPath + 
+                                            File.separator + pathOfClass + 
+                                            File.separator + "assets" + 
+                                            File.separator + assetFileName);
+                                    FileUtils.copyFile(assetFile, destFile);
+                                    
+                                    destFile = new File(outputFolderPath.replace("js-debug", "js-release") + 
+                                            File.separator + pathOfClass + 
+                                            File.separator + "assets" + 
+                                            File.separator + assetFileName);
+                                    FileUtils.copyFile(assetFile, destFile);
+                                    
+    	                            System.out.println("Copied assets of the '" + nameOfClass + "' class");
+    				            }
+    				        }
+    				    }
+    				}
+    			} catch (IOException e) {
+    				System.out.println("Error copying file for class: " + className);
+    			}
+    			return fn;
+    		}
+        }
+        
+		System.out.println("Could not find file for class: " + className);
+		problems.add(new FileNotFoundProblem(className));
+		problemsFound = true;
+		return "";
+	}
+	
+	private ArrayList<String> getDirectDependencies(String fn)
+	{
+		ArrayList<String> deps = new ArrayList<String>();
+		
+		FileInputStream fis;
+		try {
+			fis = new FileInputStream(fn);
+			Scanner scanner = new Scanner(fis, "UTF-8");
+			boolean inInjectHTML = false;
+			while (scanner.hasNextLine())
+			{
+				String s = scanner.nextLine();
+				if (s.indexOf("goog.inherits") > -1)
+					break;
+                if (inInjectHTML)
+                {
+                    int c = s.indexOf("</inject_html>");
+                    if (c > -1)
+                    {
+                        inInjectHTML = false;
+                        continue;
+                    }
+                }    
+                if (inInjectHTML)
+                {
+				    additionalHTML.add(s);
+				    continue;
+                }
+				int c = s.indexOf("goog.require");
+				if (c > -1)
+				{
+					int c2 = s.indexOf(")");
+					s = s.substring(c + 14, c2 - 1);
+					deps.add(s);
+				}
+                c = s.indexOf("<inject_html>");
+                if (c > -1)
+                {
+                    inInjectHTML = true;
+                }
+			}
+			scanner.close();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		return deps;
+	}
+	
+	private String getDependencies(ArrayList<String> deps)
+	{
+		String s = "";
+		for (String dep : deps)
+		{
+			if (s.length() > 0)
+			{
+				s += ", ";
+			}
+			s += "'" + dep + "'";			
+		}
+		return s;
+	}
+
+	String relativePath(String path)
+	{
+        if (path.indexOf(outputFolderPath) == 0)
+        {
+            path = path.replace(outputFolderPath, "../../..");
+        }
+        else
+        {
+    	    for (String otherPath : otherPaths)
+    	    {
+        		if (path.indexOf(otherPath) == 0)
+        		{
+        			path = path.replace(otherPath, "../../..");
+        			
+        		}
+    	    }
+        }
+		// paths are actually URIs and always have forward slashes
+		path = path.replace('\\', '/');
+		return path;
+	}
+	private class GoogDep
+	{
+		public String filePath;
+		public String className;
+		public ArrayList<String> deps;
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/667f93e7/compiler.jx/src/org/apache/flex/compiler/utils/VF2JSClosureCompilerWrapper.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/utils/VF2JSClosureCompilerWrapper.java b/compiler.jx/src/org/apache/flex/compiler/utils/VF2JSClosureCompilerWrapper.java
new file mode 100644
index 0000000..9fdf8d3
--- /dev/null
+++ b/compiler.jx/src/org/apache/flex/compiler/utils/VF2JSClosureCompilerWrapper.java
@@ -0,0 +1,226 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.logging.Level;
+
+import com.google.javascript.jscomp.CheckLevel;
+import com.google.javascript.jscomp.CommandLineRunner;
+import com.google.javascript.jscomp.CompilationLevel;
+import com.google.javascript.jscomp.Compiler;
+import com.google.javascript.jscomp.CompilerOptions;
+import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
+import com.google.javascript.jscomp.DiagnosticGroups;
+import com.google.javascript.jscomp.SourceFile;
+import com.google.javascript.jscomp.SourceMap;
+import com.google.javascript.jscomp.WarningLevel;
+import com.google.javascript.rhino.Node;
+import com.google.javascript.rhino.Token;
+
+public class VF2JSClosureCompilerWrapper
+{
+
+    public VF2JSClosureCompilerWrapper()
+    {
+        Compiler.setLoggingLevel(Level.ALL);
+
+        compiler_ = new Compiler();
+
+        options_ = new CompilerOptions();
+        initOptions();
+        
+        jsExternsFiles_ = new ArrayList<SourceFile>();
+        initExterns();
+
+        jsSourceFiles_ = new ArrayList<SourceFile>();
+    }
+
+    private Compiler compiler_;
+    private CompilerOptions options_;
+    private List<SourceFile> jsExternsFiles_;
+    private List<SourceFile> jsSourceFiles_;
+    
+    public String targetFilePath;
+    
+    public void addJSExternsFile(String fileName)
+    {
+        addJSExternsFile(SourceFile.fromFile(fileName));
+    }
+    
+    public void addJSExternsFile(SourceFile file)
+    {
+        jsExternsFiles_.add(file);
+    }
+    
+    public void addJSSourceFile(String fileName)
+    {
+        jsSourceFiles_.add(SourceFile.fromFile(fileName));
+    }
+    
+    public void compile()
+    {
+        compiler_.compile(jsExternsFiles_, jsSourceFiles_, options_);
+
+        try
+        {
+            FileWriter targetFile = new FileWriter(targetFilePath);
+            targetFile.write(compiler_.toSource());
+            targetFile.close();
+            
+            FileWriter sourceMapFile = new FileWriter(options_.sourceMapOutputPath);
+            compiler_.getSourceMap().appendTo(sourceMapFile, "");
+            sourceMapFile.close();
+        }
+        catch (IOException error)
+        {
+            System.out.println(error);
+        }
+    }
+    
+    private void initExterns()
+    {
+        try
+        {
+            List<SourceFile> defaultExterns = CommandLineRunner.getDefaultExterns();
+            for (SourceFile defaultExtern : defaultExterns)
+            {
+                this.addJSExternsFile(defaultExtern);
+            }
+        }
+        catch (IOException error)
+        {
+            System.out.println(error);
+        }
+    }
+    
+    private void initOptions()
+    {
+        CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(
+                options_);
+        
+        WarningLevel.VERBOSE.setOptionsForWarningLevel(options_);
+        
+        String[] asdocTags = new String[] {"productversion", 
+        		"playerversion", "langversion", "copy"};
+        options_.setExtraAnnotationNames(Arrays.asList(asdocTags));
+    }
+    
+    public void setOptions(String sourceMapPath, boolean useStrictPublishing)
+    {
+        if (useStrictPublishing)
+        {
+            // (erikdebruin) set compiler flags to 'strictest' to allow maximum
+            //               code optimization
+
+            options_.getDefineReplacements().put(
+                    "goog.DEBUG", new Node(Token.TRUE));
+            
+            // ToDo (erikdebruin): re-evaluate this option on future GC release
+            options_.setLanguageIn(LanguageMode.ECMASCRIPT6_STRICT);
+            
+            options_.setPreferSingleQuotes(true);
+            
+            options_.setFoldConstants(true);
+            options_.setDeadAssignmentElimination(true);
+            options_.setInlineConstantVars(true);
+            options_.setInlineFunctions(true);
+            options_.setInlineLocalFunctions(true);
+            options_.setCrossModuleCodeMotion(true);
+            options_.setCoalesceVariableNames(true);
+            options_.setCrossModuleMethodMotion(true);
+            options_.setInlineGetters(true);
+            options_.setInlineVariables(true);
+            options_.setSmartNameRemoval(true);
+            options_.setRemoveDeadCode(true);
+            options_.setCheckMissingReturn(CheckLevel.WARNING);
+            options_.setExtractPrototypeMemberDeclarations(true);
+            options_.setRemoveUnusedPrototypeProperties(true);
+            options_.setRemoveUnusedPrototypePropertiesInExterns(true);
+            options_.setRemoveUnusedClassProperties(true);
+            options_.setRemoveUnusedVars(true);
+            options_.setRemoveUnusedLocalVars(true);
+            options_.setAliasExternals(true);
+            options_.setCollapseVariableDeclarations(true);
+            options_.setCollapseAnonymousFunctions(true);
+            options_.setAliasAllStrings(true);
+            options_.setConvertToDottedProperties(true);
+            options_.setRewriteFunctionExpressions(true);
+            options_.setOptimizeParameters(true);
+            options_.setOptimizeReturns(true);
+            options_.setOptimizeCalls(true);
+            options_.setOptimizeArgumentsArray(true);
+            
+            // warnings already activated in previous incarnation
+            options_.setWarningLevel(DiagnosticGroups.ACCESS_CONTROLS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CONST, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CONSTANT_PROPERTY, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.STRICT_MODULE_DEP_CHECK, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.VISIBILITY, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DEPRECATED, CheckLevel.OFF); // OFF
+            
+            // the 'full' set of warnings
+            options_.setWarningLevel(DiagnosticGroups.AMBIGUOUS_FUNCTION_DECL, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_EVENTFUL_OBJECT_DISPOSAL, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_PROVIDES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_REGEXP, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_STRUCT_DICT_INHERITANCE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_TYPES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_USELESS_CODE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DEBUGGER_STATEMENT_PRESENT, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DUPLICATE_MESSAGE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DUPLICATE_VARS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.ES3, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.ES5_STRICT, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.EXTERNS_VALIDATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.GLOBAL_THIS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.FILEOVERVIEW_JSDOC, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.INTERNET_EXPLORER_CHECKS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.INVALID_CASTS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.LINT_CHECKS, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.MISPLACED_TYPE_ANNOTATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_PROPERTIES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_PROVIDE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_REQUIRE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_RETURN, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.NEW_CHECK_TYPES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.REPORT_UNKNOWN_TYPES, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.SUSPICIOUS_CODE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.TWEAKS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.TYPE_INVALIDATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNDEFINED_NAMES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNDEFINED_VARIABLES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNKNOWN_DEFINES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNNECESSARY_CASTS, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.USE_OF_GOOG_BASE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.VIOLATED_MODULE_DEP, CheckLevel.WARNING);
+        }
+        
+        options_.sourceMapFormat = SourceMap.Format.V3;
+        options_.sourceMapOutputPath = sourceMapPath + ".map";
+    }
+
+}


[10/14] git commit: [flex-falcon] [refs/heads/develop] - Another null check

Posted by er...@apache.org.
Another null check

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

Branch: refs/heads/develop
Commit: 5bbf2003c3a211f8e8cea2ec9770d92175db416f
Parents: af39216
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:37:24 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:04 2014 +0100

----------------------------------------------------------------------
 .../compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5bbf2003/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
index b0dcc61..b998545 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
@@ -938,7 +938,10 @@ public class MXMLVF2JSEmitter extends MXMLEmitter implements
                         }
                         case MXMLStyleSpecifierID:
                         {
-                            emitStyleOverride((IMXMLStyleSpecifierNode)node);
+                            if (node instanceof IMXMLStyleSpecifierNode)
+                            {
+                                emitStyleOverride((IMXMLStyleSpecifierNode)node);
+                            }
                             break;
                         }
                         case MXMLEventSpecifierID:


[02/14] git commit: [flex-falcon] [refs/heads/develop] - Add 'Container' and 'UseNamespace' node handler stubs

Posted by er...@apache.org.
Add 'Container' and 'UseNamespace' node handler stubs

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

Branch: refs/heads/develop
Commit: 86f0644ee9e7c5f63080ee7ca1e1bb5ac136c77e
Parents: 11d72ec
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:18:12 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:03 2014 +0100

----------------------------------------------------------------------
 .../apache/flex/compiler/codegen/as/IASEmitter.java |  6 ++++++
 .../compiler/internal/codegen/as/ASBlockWalker.java | 16 ++++++++++++++++
 .../compiler/internal/codegen/as/ASEmitter.java     | 11 +++++++++++
 .../internal/codegen/js/vf2js/JSVF2JSEmitter.java   | 13 +++++++++++++
 .../compiler/internal/visitor/as/ASNodeSwitch.java  | 10 ++++++++--
 .../flex/compiler/visitor/as/IASBlockVisitor.java   |  6 ++++++
 6 files changed, 60 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/86f0644e/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java b/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java
index e1c0e01..df9bbcc 100644
--- a/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java
@@ -30,6 +30,7 @@ import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
 import org.apache.flex.compiler.tree.as.IBlockNode;
 import org.apache.flex.compiler.tree.as.ICatchNode;
 import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
 import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
 import org.apache.flex.compiler.tree.as.IForLoopNode;
 import org.apache.flex.compiler.tree.as.IFunctionCallNode;
@@ -59,6 +60,7 @@ import org.apache.flex.compiler.tree.as.IThrowNode;
 import org.apache.flex.compiler.tree.as.ITryNode;
 import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
 import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
 import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
 import org.apache.flex.compiler.tree.as.IVariableNode;
 import org.apache.flex.compiler.tree.as.IWhileLoopNode;
@@ -354,6 +356,10 @@ public interface IASEmitter extends IEmitter
 
     void emitMetaTag(IMetaTagNode node);
 
+    void emitContainer(IContainerNode node);
+
     void emitE4XFilter(IMemberAccessExpressionNode node);
 
+    void emitUseNamespace(IUseNamespaceNode node);
+
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/86f0644e/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
index 069e934..293d8e8 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
@@ -33,6 +33,7 @@ import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
 import org.apache.flex.compiler.tree.as.IBlockNode;
 import org.apache.flex.compiler.tree.as.ICatchNode;
 import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
 import org.apache.flex.compiler.tree.as.IDefaultXMLNamespaceNode;
 import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
 import org.apache.flex.compiler.tree.as.IEmbedNode;
@@ -70,6 +71,7 @@ import org.apache.flex.compiler.tree.as.IThrowNode;
 import org.apache.flex.compiler.tree.as.ITryNode;
 import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
 import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
 import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
 import org.apache.flex.compiler.tree.as.IVariableNode;
 import org.apache.flex.compiler.tree.as.IWhileLoopNode;
@@ -549,6 +551,13 @@ public class ASBlockWalker implements IASBlockVisitor, IASBlockWalker
     }
 
     @Override
+    public void visitUseNamespace(IUseNamespaceNode node)
+    {
+        debug("visitUseNamespace(" + node.getTargetNamespace() + ")");
+        emitter.emitUseNamespace(node);
+    }
+
+    @Override
     public void visitEmbed(IEmbedNode node)
     {
         debug("visitEmbed(" + node.getAttributes()[0].getValue() + ")");
@@ -556,6 +565,13 @@ public class ASBlockWalker implements IASBlockVisitor, IASBlockWalker
     }
 
     @Override
+    public void visitContainer(IContainerNode node)
+    {
+        debug("visitContainer()");
+        emitter.emitContainer(node);
+    }
+
+    @Override
     public void visitE4XFilter(IMemberAccessExpressionNode node)
     {
         debug("visitE4XFilter()");

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/86f0644e/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 cd08e22..b84d1f2 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
@@ -88,6 +88,7 @@ import org.apache.flex.compiler.tree.as.ITryNode;
 import org.apache.flex.compiler.tree.as.ITypeNode;
 import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
 import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
 import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
 import org.apache.flex.compiler.tree.as.IVariableNode;
 import org.apache.flex.compiler.tree.as.IWhileLoopNode;
@@ -1448,8 +1449,18 @@ public class ASEmitter implements IASEmitter, IEmitter
     {
     }
 
+    public void emitContainer(IContainerNode node)
+    {
+    }
+
     public void emitE4XFilter(IMemberAccessExpressionNode node)
     {
+    	// ToDo (erikdebruin)
+    }
+
+    public void emitUseNamespace(IUseNamespaceNode node)
+    {
+    	// ToDo (erikdebruin)
     }
 
     public String stringifyNode(IASNode node)

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/86f0644e/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 0ca8e4b..5b230e1 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
@@ -1719,4 +1719,17 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         write(ASEmitterTokens.SINGLE_QUOTE);
     }
 
+    @Override
+    public void emitContainer(IContainerNode node)
+    {
+        int nodeCount = node.getChildCount();
+        for (int i = 0; i < nodeCount; i++)
+        {
+            getWalker().walk(node.getChild(i));
+            
+            if (i < nodeCount - 1)
+            	writeToken(ASEmitterTokens.COMMA);
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/86f0644e/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java b/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
index a64b599..cd75f31 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
@@ -29,6 +29,7 @@ import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
 import org.apache.flex.compiler.tree.as.IBlockNode;
 import org.apache.flex.compiler.tree.as.ICatchNode;
 import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
 import org.apache.flex.compiler.tree.as.IDefaultXMLNamespaceNode;
 import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
 import org.apache.flex.compiler.tree.as.IEmbedNode;
@@ -63,6 +64,7 @@ import org.apache.flex.compiler.tree.as.IThrowNode;
 import org.apache.flex.compiler.tree.as.ITryNode;
 import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
 import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
 import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
 import org.apache.flex.compiler.tree.as.IVariableNode;
 import org.apache.flex.compiler.tree.as.IWhileLoopNode;
@@ -109,7 +111,7 @@ public class ASNodeSwitch implements IASNodeStrategy
         switch (node.getNodeID())
         {
         case ContainerID:
-            // ToDo (erikdebruin): implement handler
+            visitor.visitContainer((IContainerNode) node);
             return;
 
         case ConfigBlockID:
@@ -314,7 +316,11 @@ public class ASNodeSwitch implements IASNodeStrategy
         }
 
         // IExpressionNode
-        if (node instanceof IEmbedNode)
+        if (node instanceof IUseNamespaceNode)
+        {
+            visitor.visitUseNamespace((IUseNamespaceNode) node);
+        }
+        else if (node instanceof IEmbedNode)
         {
             visitor.visitEmbed((IEmbedNode) node);
         }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/86f0644e/compiler.jx/src/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java b/compiler.jx/src/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java
index 0376dba..db3cda0 100644
--- a/compiler.jx/src/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java
+++ b/compiler.jx/src/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java
@@ -26,6 +26,7 @@ import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
 import org.apache.flex.compiler.tree.as.IBlockNode;
 import org.apache.flex.compiler.tree.as.ICatchNode;
 import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
 import org.apache.flex.compiler.tree.as.IDefaultXMLNamespaceNode;
 import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
 import org.apache.flex.compiler.tree.as.IEmbedNode;
@@ -60,6 +61,7 @@ import org.apache.flex.compiler.tree.as.IThrowNode;
 import org.apache.flex.compiler.tree.as.ITryNode;
 import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
 import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
 import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
 import org.apache.flex.compiler.tree.as.IVariableNode;
 import org.apache.flex.compiler.tree.as.IWhileLoopNode;
@@ -216,8 +218,12 @@ public interface IASBlockVisitor extends IBlockVisitor
 
     void visitMetaTag(IMetaTagNode node);
 
+    void visitUseNamespace(IUseNamespaceNode node);
+
     void visitEmbed(IEmbedNode node);
 
+    void visitContainer(IContainerNode node);
+
     void visitE4XFilter(IMemberAccessExpressionNode node);
 
 }


[11/14] git commit: [flex-falcon] [refs/heads/develop] - Added and updated VF2JS tests and test files

Posted by er...@apache.org.
Added and updated VF2JS tests and test files

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

Branch: refs/heads/develop
Commit: bd111dd430283ef20c554c5ff35d7dffaf3d2d53
Parents: 2b12a20
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:43:53 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:04 2014 +0100

----------------------------------------------------------------------
 .../codegen/js/vf2js/TestVF2JSClass.java        | 109 +++++++++++++++---
 .../codegen/js/vf2js/TestVF2JSFile.java         |  18 +++
 .../codegen/js/vf2js/TestVF2JSProject.java      |  15 +++
 .../codegen/js/vf2js/TestVF2JSStatements.java   |  11 +-
 .../mxml/vf2js/TestVF2JSMXMLApplication.java    |   3 +
 .../test-files/vf2js/files/Version.as           |   7 ++
 .../projects/interfaces/classes/B_result.js     |   3 +-
 .../projects/interfaces/classes/C_result.js     |   3 +-
 .../vf2js/projects/sdk/SomeSDKClass.as          |  68 +++++++++++
 .../vf2js/projects/sdk/SomeSDKClass_result.js   | 114 +++++++++++++++++++
 .../vf2js/projects/sdk/bases/HelperBaseClass.as |  33 ++++++
 .../sdk/bases/HelperBaseClass_result.js         |  46 ++++++++
 .../simpleMXML/src/SimpleMXML_Project_result.js |   2 +-
 .../test-files/vf2js/projects/super/Base.as     |   8 ++
 .../vf2js/projects/super/Base_result.js         |  37 +++++-
 .../vf2js/projects/super/Super_result.js        |   3 +-
 compiler.jx/downloads.xml                       |  16 +--
 17 files changed, 464 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java
index 8998868..1e6b546 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java
@@ -33,6 +33,47 @@ public class TestVF2JSClass extends TestGoogClass
 
     @Override
     @Test
+    public void testSimple()
+    {
+        IClassNode node = getClassNode("public class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleInternal()
+    {
+        // (erikdebruin) the AS compiler will enforce 'internal' namespace, 
+        //               in JS we ignore it
+        IClassNode node = getClassNode("internal class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleFinal()
+    {
+        // (erikdebruin) the AS compiler will enforce the 'final' keyword, 
+        //               in JS we ignore it
+        IClassNode node = getClassNode("public final class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleDynamic()
+    {
+        // (erikdebruin) all JS objects are 'dynamic' by design
+        IClassNode node = getClassNode("public dynamic class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
     public void testConstructor_super()
     {
         IClassNode node = getClassNode("public class A {public function A() { super(); }}");
@@ -51,6 +92,24 @@ public class TestVF2JSClass extends TestGoogClass
 
     @Override
     @Test
+    public void testSimpleImplements()
+    {
+        IClassNode node = getClassNode("public class A implements IEventDispatcher {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A implements IEventDispatcher, ILogger {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
     public void testSimpleExtendsImplements()
     {
         IClassNode node = getClassNode("public class A extends Button implements IEventDispatcher {public function A() {}}");
@@ -87,6 +146,15 @@ public class TestVF2JSClass extends TestGoogClass
 
     @Override
     @Test
+    public void testConstructor()
+    {
+        IClassNode node = getClassNode("public class A {public function A() { }}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
     public void testExtendsConstructor_super()
     {
         IClassNode node = getClassNode("public class A extends spark.components.Button { public function A() { super('foo', 42);}}");
@@ -94,6 +162,15 @@ public class TestVF2JSClass extends TestGoogClass
         assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor', 'foo', 42);\n};\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
     }
 
+    @Override
+    @Test
+    public void testConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {};");
+    }
+
     @Test
     public void testConstructor_withArgumentNameMatchingMemberName()
     {
@@ -108,7 +185,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; public var button:Button = new Button(); public function foo():String {return button.label;};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @type {spark.components.Button}\n */\norg.apache.flex.B.prototype.button = new spark.components.Button();\n\n\n/**\n * @expose\n * @return {string}\n */\norg.apache.flex.B.prototype.foo = function() {\n  return this.button.get_label();\n};";
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n  this.button = new spark.components.Button();\n};\n\n\n/**\n * @type {spark.components.Button}\n */\norg.apache.flex.B.prototype.button;\n\n\n/**\n * @expose\n * @return {string}\n */\norg.apache.flex.B.prototype.foo = function() {\n  return this.button.get_label();\n};";
         assertOut(expected);
     }
 
@@ -117,7 +194,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; public function foo():void {};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @expose\n */\norg.apache.flex.B.prototype.foo = function() {\n};";
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @expose\n */\norg.apache.flex.B.prototype.foo = function() {\n};";
         assertOut(expected);
     }
 
@@ -126,7 +203,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; override public function foo():void {};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @expose\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n};";
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @expose\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n};";
         assertOut(expected);
     }
 
@@ -135,7 +212,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; override public function foo(value:Object):void {baz = ''};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @expose\n * @param {Object} value\n * @override\n */\norg.apache.flex.B.prototype.foo = function(value) {\n  baz = '';\n};";
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @expose\n * @param {Object} value\n * @override\n */\norg.apache.flex.B.prototype.foo = function(value) {\n  baz = '';\n};";
         assertOut(expected);
     }
 
@@ -144,7 +221,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; override public function foo():void {super.foo();};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @expose\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n  org.apache.flex.B.base(this, 'foo');\n};";
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @expose\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n  org.apache.flex.B.base(this, 'foo');\n};";
         assertOut(expected);
     }
 
@@ -153,7 +230,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; public function set baz(value:Object):void {}; public function set foo(value:Object):void {baz = value;};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @expose\n * @param {Object} value\n */\norg.apache.flex.B.prototype.set_baz = function(value) {\n};\n\n\n/**\n * @expose\n * @param {Object} value\n */\norg.apache.flex.B.prototype.set_foo = function(value) {\n  this.set_baz(value);\n};";
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @expose\n * @param {Object} value\n */\norg.apache.flex.B.prototype.set_baz = function(value) {\n};\n\n\n/**\n * @expose\n * @param {Object} value\n */\norg.apache.flex.B.prototype.set_foo = function(value) {\n  this.set_baz(value);\n};";
         assertOut(expected);
     }
 
@@ -162,7 +239,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; override public function set foo(value:Object):void {super.foo = value;};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @expose\n * @param {Object} value\n * @override\n */\norg.apache.flex.B.prototype.set_foo = function(value) {\n  org.apache.flex.B.base(this, 'set_foo', value);\n};";
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @expose\n * @param {Object} value\n * @override\n */\norg.apache.flex.B.prototype.set_foo = function(value) {\n  org.apache.flex.B.base(this, 'set_foo', value);\n};";
         assertOut(expected);
     }
 
@@ -182,7 +259,7 @@ public class TestVF2JSClass extends TestGoogClass
         IClassNode node = getClassNode("public class A {public var a:Object;protected var b:String; "
                 + "private var c:int; internal var d:uint; var e:Number}");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.a;\n\n\n/**\n * @protected\n * @type {string}\n */\norg.apache.flex.A.prototype.b;\n\n\n/**\n * @private\n * @type {number}\n */\norg.apache.flex.A.prototype.c;\n\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.d;\n\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.e;");
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.a;\n\n\n/**\n * @protected\n * @type {string}\n */\norg.apache.flex.A.prototype.b;\n\n\n/**\n * @private\n * @type {number}\n */\norg.apache.flex.A.prototype.c;\n\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.d;\n\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.e;");
     }
 
     @Test
@@ -190,7 +267,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class A {[Embed(source=\"LuminosityMaskFilter.pbj\", mimeType=\"application/octet-stream\")]\nprivate static var ShaderClass:Class;}");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @private\n * @type {Object}\n */\norg.apache.flex.A.ShaderClass;");
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @private\n * @type {Object}\n */\norg.apache.flex.A.ShaderClass;");
     }
     
     @Test
@@ -198,7 +275,7 @@ public class TestVF2JSClass extends TestGoogClass
     {
     	IClassNode node = getClassNode("public class A {private var controlBarGroupProperties:Object = { visible: true }; private var _visible:Boolean; public function get visible():Boolean { return _visible; }; public function set visible(value:Boolean):void { _visible = value; };}");
     	asBlockWalker.visitClass(node);
-    	assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @private\n * @type {Object}\n */\norg.apache.flex.A.prototype.controlBarGroupProperties = {visible:true};\n\n\n/**\n * @private\n * @type {boolean}\n */\norg.apache.flex.A.prototype._visible;\n\n\n/**\n * @expose\n * @return {boolean}\n */\norg.apache.flex.A.prototype.get_visible = function() {\n  return this._visible;\n};\n\n\n/**\n * @expose\n * @param {boolean} value\n */\norg.apache.flex.A.prototype.set_visible = function(value) {\n  this._visible = value;\n};");
+    	assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @private\n * @type {Object}\n */\norg.apache.flex.A.prototype.controlBarGroupProperties = {visible:true};\n\n\n/**\n * @private\n * @type {boolean}\n */\norg.apache.flex.A.prototype._visible;\n\n\n/**\n * @expose\n * @return {boolean}\n */\norg.apache.flex.A.prototype.get_visible = function() {\n  return this._visible;\n};\n\n\n/**\n * @expose\n * @param {boolean} value\n */\norg.apache.flex.A.prototype.set_visible = function(value) {\n  this._visible = value;\n};");
     }
 
     @Override
@@ -211,7 +288,7 @@ public class TestVF2JSClass extends TestGoogClass
                 + "private static const C:Number = 42;"
                 + "foo_bar static const C:String = 'me' + 'you';");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @const\n * @type {number}\n */\norg.apache.flex.A.A = 42;\n\n\n/**\n * @protected\n * @const\n * @type {number}\n */\norg.apache.flex.A.B = 42;\n\n\n/**\n * @private\n * @const\n * @type {number}\n */\norg.apache.flex.A.C = 42;\n\n\n/**\n * @const\n * @type {string}\n */\norg.apache.flex.A.C = 'me' + 'you';");
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.C = 'me' + 'you';\n};\n\n\n/**\n * @const\n * @type {number}\n */\norg.apache.flex.A.A = 42;\n\n\n/**\n * @protected\n * @const\n * @type {number}\n */\norg.apache.flex.A.B = 42;\n\n\n/**\n * @private\n * @const\n * @type {number}\n */\norg.apache.flex.A.C = 42;\n\n\n/**\n * @const\n * @type {string}\n */\norg.apache.flex.A.C;");
     }
 
     @Override
@@ -230,7 +307,7 @@ public class TestVF2JSClass extends TestGoogClass
                 + "foo_bar function get foo6():Object{return null;}"
                 + "foo_bar function set foo6(value:Object):void{}" + "}");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo1 = function() {\n  return null;\n};\n\n\n/**\n * @expose\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo1 = function(value) {\n};\n\n\n/**\n * @protected\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo2 = function() {\n  return null;\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo3 = function() {\n  return null;\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo3 = function(value) {\n};\n\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo5 = function() {\n  return null;\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo5 = function(value) 
 {\n};\n\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo6 = function() {\n  return null;\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo6 = function(value) {\n};");
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo1 = function() {\n  return null;\n};\n\n\n/**\n * @expose\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo1 = function(value) {\n};\n\n\n/**\n * @protected\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo2 = function() {\n  return null;\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo3 = function() {\n  return null;\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo3 = function(value) {\n};\n\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo5 = function() {\n  return null;\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo5 = function(value) {\
 n};\n\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo6 = function() {\n  return null;\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo6 = function(value) {\n};");
     }
 
     @Override
@@ -248,7 +325,7 @@ public class TestVF2JSClass extends TestGoogClass
                 + "public static function foo7(value:Object):void{}"
                 + "foo_bar static function foo7(value:Object):void{}" + "}");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1 = function() {\n  return null;\n};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1a = function() {\n  return null;\n};\n\n\n/**\n * @expose\n * @return {Object}\n * @override\n */\norg.apache.flex.A.prototype.foo1b = function() {\n  return org.apache.flex.A.base(this, 'foo1b');\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo3 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo5 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo6 = function(value) {\n};\n\n\n/**\n * @expose\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n
 };\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};");
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1 = function() {\n  return null;\n};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1a = function() {\n  return null;\n};\n\n\n/**\n * @expose\n * @return {Object}\n * @override\n */\norg.apache.flex.A.prototype.foo1b = function() {\n  return org.apache.flex.A.base(this, 'foo1b');\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo3 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo5 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo6 = function(value) {\n};\n\n\n/**\n * @expose\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};
 \n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};");
     }
 
     @Test
@@ -259,7 +336,7 @@ public class TestVF2JSClass extends TestGoogClass
                 + "public function foo2():Object{function bar2(param1:Object):Object {return null;}; return bar2('foo');}"
                 + "}");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.B.prototype.foo1 = function() {\n  function bar1() {\n    return null;\n  };\n  return goog.bind(bar1, this)();\n};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.B.prototype.foo2 = function() {\n  function bar2(param1) {\n    return null;\n  };\n  return goog.bind(bar2, this)('foo');\n};");
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.B.prototype.foo1 = function() {\n  function bar1() {\n    return null;\n  };\n  return goog.bind(bar1, this)();\n};\n\n\n/**\n * @expose\n * @return {Object}\n */\norg.apache.flex.B.prototype.foo2 = function() {\n  function bar2(param1) {\n    return null;\n  };\n  return goog.bind(bar2, this)('foo');\n};");
     }
 
     @Test
@@ -271,7 +348,7 @@ public class TestVF2JSClass extends TestGoogClass
                 + "public function foo2():String{function bar2(param1:String):String {return param1 + baz1;}; return bar2('foo');}"
                 + "}");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @type {string}\n */\norg.apache.flex.B.prototype.baz1;\n\n\n/**\n * @expose\n * @return {string}\n */\norg.apache.flex.B.prototype.foo1 = function() {\n  function bar1() {\n    return this.baz1;\n  };\n  return goog.bind(bar1, this)();\n};\n\n\n/**\n * @expose\n * @return {string}\n */\norg.apache.flex.B.prototype.foo2 = function() {\n  function bar2(param1) {\n    return param1 + this.baz1;\n  };\n  return goog.bind(bar2, this)('foo');\n};");
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @type {string}\n */\norg.apache.flex.B.prototype.baz1;\n\n\n/**\n * @expose\n * @return {string}\n */\norg.apache.flex.B.prototype.foo1 = function() {\n  function bar1() {\n    return this.baz1;\n  };\n  return goog.bind(bar1, this)();\n};\n\n\n/**\n * @expose\n * @return {string}\n */\norg.apache.flex.B.prototype.foo2 = function() {\n  function bar2(param1) {\n    return param1 + this.baz1;\n  };\n  return goog.bind(bar2, this)('foo');\n};");
     }
 
     @Test
@@ -291,7 +368,7 @@ public class TestVF2JSClass extends TestGoogClass
                 + "public function clone():B { return new B() }"
                 + "}");
         asBlockWalker.visitClass(node);
-        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @expose\n * @return {org.apache.flex.B}\n */\norg.apache.flex.B.prototype.clone = function() {\n  return new org.apache.flex.B();\n};");
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @expose\n * @return {org.apache.flex.B}\n */\norg.apache.flex.B.prototype.clone = function() {\n  return new org.apache.flex.B();\n};");
     }
 
     protected IBackend createBackend()

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
index 66a591d..56bb290 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
@@ -56,6 +56,24 @@ public class TestVF2JSFile extends VF2JSTestBase
         assertOut(getCodeFromFile(fileName + "_result", true,
                 "vf2js" + File.separator + "files"));
     }
+	
+    @Test
+    public void testVersion()
+    {
+        String fileName = "Version";
+
+        IFileNode node = compileAS(fileName, true,
+                "test-files"
+                        + File.separator + "vf2js" + File.separator + "files",
+                false);
+        
+        asBlockWalker.visitFile(node);
+        
+        //writeResultToFile(writer.toString(), fileName);
+        
+        assertOut(getCodeFromFile(fileName + "_result", true,
+                "vf2js" + File.separator + "files"));
+    }
 
     @Override
     protected void addSourcePaths(List<File> sourcePaths)

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
index 06984bd..5160272 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
@@ -69,6 +69,18 @@ public class TestVF2JSProject extends TestGoogProject
     }
 
     @Test
+    public void test_SDKTricks()
+    {
+        String testDirPath = projectDirPath + "/sdk";
+
+        String fileName = "SomeSDKClass";
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
     public void test_Super()
     {
         String testDirPath = projectDirPath + "/super";
@@ -87,6 +99,9 @@ public class TestVF2JSProject extends TestGoogProject
                 + File.separator + projectDirPath + "/interfaces")));
 
         sourcePaths.add(new File(FilenameNormalization.normalize("test-files"
+                + File.separator + projectDirPath + "/sdk")));
+
+        sourcePaths.add(new File(FilenameNormalization.normalize("test-files"
                 + File.separator + projectDirPath + "/super")));
 
         super.addSourcePaths(sourcePaths);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java
index 648666f..061be59 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java
@@ -135,6 +135,15 @@ public class TestVF2JSStatements extends TestGoogStatements
         asBlockWalker.visitForLoop(node);
         assertOut("for (var /** @type {number} */ i = 0; i < len; i++)\n  break;");
     }
+    
+    @Test
+    public void testVisitFor_1c()
+    {
+    	IForLoopNode node = (IForLoopNode) getNode(
+    			"for (var i:int = 0, j:int = 3; i < j; i++) break;", IForLoopNode.class);
+    	asBlockWalker.visitForLoop(node);
+    	assertOut("for (var /** @type {number} */ i = 0, /** @type {number} */ j = 3; i < j; i++)\n  break;");
+    }
 
     @Override
     @Test
@@ -516,7 +525,7 @@ public class TestVF2JSStatements extends TestGoogStatements
                         + "foo: for each(var i:int in obj) break foo;",
                 IFileNode.class);
         asBlockWalker.visitFile(node);
-        assertOut("/**\n * FalconTest_A\n *\n * @fileoverview\n *\n * @suppress {checkTypes}\n */\n\ngoog.provide('FalconTest_A');\n\n\n\n/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nFalconTest_A.prototype.falconTest_a = function() {\n  try {\n    a;\n  } catch (e) {\n    if (a) {\n      if (b) {\n        if (c)\n          b;\n        else if (f)\n          a;\n        else\n          e;\n      }\n    }\n  } finally {\n  }\n  if (d)\n    for (var /** @type {number} */ i = 0; i < len; i++)\n      break;\n  if (a) {\n    with (ab) {\n      c();\n    }\n    do {\n      a++;\n      do\n        a++;\n      while (a > b);\n    } while (c > d);\n  }\n  if (b) {\n    try {\n      a;\n      throw new Error('foo');\n    } catch (e) {\n      switch (i) {\n        case 1:\n          break;\n        default:\n          return;\n      }\n    } finally {\n      d;\n      var /** @type {Object} */ a = function(foo, bar) {\n        bar = typeof bar !== 'undefined' ? bar : 'goo';\n
         return -1;\n      };\n      eee.dd;\n      eee.dd;\n      eee.dd;\n      eee.dd;\n    }\n  }\n  foo : for (var foreachiter0 in obj) \n  {\n  var i = obj[foreachiter0];\n  \n    break foo;}\n  ;\n};\n\n\n/**\n * Metadata\n *\n * @type {Object.<string, Array.<Object>>}\n */\nFalconTest_A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'FalconTest_A', qName: 'FalconTest_A'}] };\n");
+        assertOut("/**\n * FalconTest_A\n *\n * @fileoverview\n *\n * @suppress {checkTypes}\n */\n\ngoog.provide('FalconTest_A');\n\n\n\n/**\n * @constructor\n */\nFalconTest_A = function() {};\n\n\nFalconTest_A.prototype.falconTest_a = function() {\n  try {\n    a;\n  } catch (e) {\n    if (a) {\n      if (b) {\n        if (c)\n          b;\n        else if (f)\n          a;\n        else\n          e;\n      }\n    }\n  } finally {\n  }\n  if (d)\n    for (var /** @type {number} */ i = 0; i < len; i++)\n      break;\n  if (a) {\n    with (ab) {\n      c();\n    }\n    do {\n      a++;\n      do\n        a++;\n      while (a > b);\n    } while (c > d);\n  }\n  if (b) {\n    try {\n      a;\n      throw new Error('foo');\n    } catch (e) {\n      switch (i) {\n        case 1:\n          break;\n        default:\n          return;\n      }\n    } finally {\n      d;\n      var /** @type {Object} */ a = function(foo, bar) {\n        bar = typeof bar !== 'undefined' ? bar : 'goo';\n  
       return -1;\n      };\n      eee.dd;\n      eee.dd;\n      eee.dd;\n      eee.dd;\n    }\n  }\n  foo : for (var foreachiter0 in obj) \n  {\n  var i = obj[foreachiter0];\n  \n    break foo;}\n  ;\n};\n\n\n/**\n * Metadata\n *\n * @type {Object.<string, Array.<Object>>}\n */\nFalconTest_A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'FalconTest_A', qName: 'FalconTest_A'}] };\n");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
index 376e95d..4aa4856 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
@@ -66,6 +66,9 @@ public class TestVF2JSMXMLApplication extends VF2JSMXMLTestBase
 
         List<String> compiledFileNames = compileProject(fileName, testDirPath);
 
+        // ToDo (erikdebruin): MXML property initialized with a FunctionCall
+        //                     are not included in the output (the assignment 
+        //                     should be handled in the constructor, like in AS
         assertProjectOut(compiledFileNames, testDirPath);
     }
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/files/Version.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/files/Version.as b/compiler.jx.tests/test-files/vf2js/files/Version.as
new file mode 100644
index 0000000..322d76b
--- /dev/null
+++ b/compiler.jx.tests/test-files/vf2js/files/Version.as
@@ -0,0 +1,7 @@
+import mx.core.mx_internal;
+
+/**
+ *  @private
+ *  Version string for this class.
+ */
+mx_internal static const VERSION:String = "4.14.0.0";

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/B_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/B_result.js b/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/B_result.js
index 2fef89c..d8e3b89 100644
--- a/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/B_result.js
+++ b/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/B_result.js
@@ -26,8 +26,7 @@ goog.provide('classes.B');
 /**
  * @constructor
  */
-classes.B = function() {
-};
+classes.B = function() {};
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/C_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/C_result.js b/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/C_result.js
index 729cda3..c3b72f4 100644
--- a/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/C_result.js
+++ b/compiler.jx.tests/test-files/vf2js/projects/interfaces/classes/C_result.js
@@ -26,8 +26,7 @@ goog.provide('classes.C');
 /**
  * @constructor
  */
-classes.C = function() {
-};
+classes.C = function() {};
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/sdk/SomeSDKClass.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/sdk/SomeSDKClass.as b/compiler.jx.tests/test-files/vf2js/projects/sdk/SomeSDKClass.as
new file mode 100644
index 0000000..52541c2
--- /dev/null
+++ b/compiler.jx.tests/test-files/vf2js/projects/sdk/SomeSDKClass.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//	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
+{
+
+import mx.core.mx_internal;
+
+import bases.HelperBaseClass;
+
+use namespace mx_internal;
+
+public class SomeSDKClass
+{
+	public function SomeSDKClass() {}; 
+
+	private var number:Number = 'Got it: ' + this.getString(); 
+
+	public function getString():String
+	{
+		return Helper.helperFunction();
+	}
+
+	public function someFunction():String
+	{
+		helperBaseClass.doSomething();
+	}
+
+	mx_internal var helperBaseClass:HelperBaseClass = new HelperBaseClass();
+}
+
+}
+
+import bases.HelperBaseClass;
+
+class Helper extends HelperBaseClass
+{
+
+	public static function helperFunction():String {
+		return "Hello world";
+	}
+	
+	public function Helper(url:String) {
+	  url_ = url;
+	}
+	
+	private var url_:String;
+	
+	public function get url():String {
+		return url_;
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/sdk/SomeSDKClass_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/sdk/SomeSDKClass_result.js b/compiler.jx.tests/test-files/vf2js/projects/sdk/SomeSDKClass_result.js
new file mode 100644
index 0000000..a622dc1
--- /dev/null
+++ b/compiler.jx.tests/test-files/vf2js/projects/sdk/SomeSDKClass_result.js
@@ -0,0 +1,114 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * SomeSDKClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('SomeSDKClass');
+
+goog.require('mx.core.mx_internal');
+goog.require('bases.HelperBaseClass');
+goog.require('org.apache.flex.utils.Language');
+
+
+
+/**
+ * @constructor
+ */
+SomeSDKClass = function() {
+  this.number = 'Got it: ' + this.getString();
+
+  this.helperBaseClass = new bases.HelperBaseClass();
+};
+
+
+/**
+ * @private
+ * @type {number}
+ */
+SomeSDKClass.prototype.number;
+
+
+/**
+ * @expose
+ * @return {string}
+ */
+SomeSDKClass.prototype.getString = function() {
+  return Helper.helperFunction();
+};
+
+
+/**
+ * @expose
+ * @return {string}
+ */
+SomeSDKClass.prototype.someFunction = function() {
+  this.helperBaseClass.doSomething();
+};
+
+
+/**
+ * @type {bases.HelperBaseClass}
+ */
+SomeSDKClass.prototype.helperBaseClass;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+SomeSDKClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SomeSDKClass', qName: 'SomeSDKClass'}] };
+
+
+
+/**
+ * @constructor
+ * @extends {bases.HelperBaseClass}
+ * @param {string} url
+ */
+Helper = function(url) {
+  Helper.base(this, 'constructor', url);
+  this.url_ = url;
+};
+goog.inherits(Helper, bases.HelperBaseClass);
+
+
+/**
+ * @expose
+ * @return {string}
+ */
+Helper.helperFunction = function() {
+  return "Hello world";
+};
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Helper.prototype.url_;
+
+
+/**
+ * @expose
+ * @return {string}
+ */
+Helper.prototype.get_url = function() {
+  return this.url_;
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/sdk/bases/HelperBaseClass.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/sdk/bases/HelperBaseClass.as b/compiler.jx.tests/test-files/vf2js/projects/sdk/bases/HelperBaseClass.as
new file mode 100644
index 0000000..487990a
--- /dev/null
+++ b/compiler.jx.tests/test-files/vf2js/projects/sdk/bases/HelperBaseClass.as
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//	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 bases
+{
+
+public class HelperBaseClass
+{
+	
+	public function HelperBaseClass() {};
+	
+	public function doSomething():String {
+		return 'doneSomething';
+	}
+
+}
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/sdk/bases/HelperBaseClass_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/sdk/bases/HelperBaseClass_result.js b/compiler.jx.tests/test-files/vf2js/projects/sdk/bases/HelperBaseClass_result.js
new file mode 100644
index 0000000..9d18b3d
--- /dev/null
+++ b/compiler.jx.tests/test-files/vf2js/projects/sdk/bases/HelperBaseClass_result.js
@@ -0,0 +1,46 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * bases.HelperBaseClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('bases.HelperBaseClass');
+
+
+
+/**
+ * @constructor
+ */
+bases.HelperBaseClass = function() {};
+
+
+/**
+ * @expose
+ * @return {string}
+ */
+bases.HelperBaseClass.prototype.doSomething = function() {
+  return 'doneSomething';
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+bases.HelperBaseClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'HelperBaseClass', qName: 'bases.HelperBaseClass'}] };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js b/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js
index aaad9b6..2ad1ea6 100644
--- a/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js
+++ b/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js
@@ -50,7 +50,7 @@ SimpleMXML_Project.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SimpleMXML_P
  * @private
  * @type {example.Component}
  */
-SimpleMXML_Project.prototype.myComponent = new example.Component();
+SimpleMXML_Project.prototype.myComponent;
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/super/Base.as
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/super/Base.as b/compiler.jx.tests/test-files/vf2js/projects/super/Base.as
index 8dccc35..3cc5462 100644
--- a/compiler.jx.tests/test-files/vf2js/projects/super/Base.as
+++ b/compiler.jx.tests/test-files/vf2js/projects/super/Base.as
@@ -22,11 +22,19 @@ package
 
 	public class Base extends Super
 	{
+		public static var myClassConst:String = new Number();
+		
 		public function Base() 
 		{
 			super();
 		}; 
 
+		private var number:Number = this.getNumber(); 
+		
+		private var newText:String = this.text; 
+		
+		private var newTextAgain:String = text; 
+		
 		override public function get text():String 
 		{
 			return "A" + super.text;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/super/Base_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/super/Base_result.js b/compiler.jx.tests/test-files/vf2js/projects/super/Base_result.js
index cd666d4..b5063c6 100644
--- a/compiler.jx.tests/test-files/vf2js/projects/super/Base_result.js
+++ b/compiler.jx.tests/test-files/vf2js/projects/super/Base_result.js
@@ -31,12 +31,47 @@ goog.require('org.apache.flex.utils.Language');
  * @extends {Super}
  */
 Base = function() {
+  
+    Base.myClassConst = new Number();
+  
+    this.number = this.getNumber();
+  
+    this.newText = this.get_text();
+  
+    this.newTextAgain = this.get_text();
   Base.base(this, 'constructor');
 };
 goog.inherits(Base, Super);
 
 
 /**
+ * @type {string}
+ */
+Base.myClassConst;
+
+
+/**
+ * @private
+ * @type {number}
+ */
+Base.prototype.number;
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Base.prototype.newText;
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Base.prototype.newTextAgain;
+
+
+/**
  * @expose
  * @return {string}
  * @override
@@ -71,4 +106,4 @@ Base.prototype.getNumber = function() {
  *
  * @type {Object.<string, Array.<Object>>}
  */
-Base.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Base', qName: 'Base'}] };
+Base.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Base', qName: 'Base'}] };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx.tests/test-files/vf2js/projects/super/Super_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/projects/super/Super_result.js b/compiler.jx.tests/test-files/vf2js/projects/super/Super_result.js
index 9082c3e..f4fdb42 100644
--- a/compiler.jx.tests/test-files/vf2js/projects/super/Super_result.js
+++ b/compiler.jx.tests/test-files/vf2js/projects/super/Super_result.js
@@ -26,8 +26,7 @@ goog.provide('Super');
 /**
  * @constructor
  */
-Super = function() {
-};
+Super = function() {};
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/bd111dd4/compiler.jx/downloads.xml
----------------------------------------------------------------------
diff --git a/compiler.jx/downloads.xml b/compiler.jx/downloads.xml
index f6f9150..2a57a71 100644
--- a/compiler.jx/downloads.xml
+++ b/compiler.jx/downloads.xml
@@ -81,16 +81,18 @@
 
     <!--  closure -->
     <property name="closure.name" value="compiler"/>
-    <property name="closure.version" value="20140625"/>
+    <property name="closure.version" value="20141023"/>
+    <!-- property name="closure.version" value="20140625"/ -->
     <!-- property name="closure.version" value="20140508"/ -->
     <property name="closure.dest.folder" value="google/closure-compiler"/>
     <property name="closure.dest.filename" value="${closure.name}.jar"/>
     <antcall target="download-dependency-closure">
       <param name="name" value="${closure.name}"/>
-      <param name="src.server" value="https://github.com"/>
-      <param name="src.folder" value="google/closure-compiler/archive"/>
-      <param name="src.filename" value="v${closure.version}.zip"/>
-      <param name="src.checksum" value="2cc65539b3ccaa1cf6f08c81fb7cdef3"/>
+      <param name="src.server" value="http://dl.google.com"/>
+      <param name="src.folder" value="closure-compiler"/>
+      <param name="src.filename" value="compiler-${closure.version}.zip"/>
+      <param name="src.checksum" value="91a73299a09ba5087c3bc5af5891219f"/>
+      <!-- param name="src.checksum" value="2cc65539b3ccaa1cf6f08c81fb7cdef3"/ --><!-- 20140625 -->
       <!-- param name="src.checksum" value="b4e4e20f32730b2aeb220e306f605236"/ --><!-- v20140508 -->
       <param name="dest.folder" value="${closure.dest.folder}"/>
       <param name="dest.filename" value="${closure.dest.filename}"/>
@@ -216,9 +218,9 @@
       <param name="checksum" value="${src.checksum}"/>
     </antcall>
 
-    <ant dir="${download.dir}/temp/closure-compiler-${closure.version}" inheritAll="false" />
+    <!-- ant dir="${download.dir}/temp/closure-compiler-${closure.version}" inheritAll="false" / -->
 
-    <copy file="${download.dir}/temp/closure-${closure.name}-${closure.version}/build/${closure.name}.jar" toFile="${lib.dir}/${closure.dest.folder}/${closure.dest.filename}" verbose="true"/>
+    <copy file="${download.dir}/temp/${closure.name}.jar" toFile="${lib.dir}/${closure.dest.folder}/${closure.dest.filename}" verbose="true"/>
   </target>
 
   <target name="download-dependency-jar" if="project.download.jar" description="Downloads a jar to the lib directory.">


[07/14] git commit: [flex-falcon] [refs/heads/develop] - Add support for additional 'root' nodes in a file, e.g. helper classes

Posted by er...@apache.org.
Add support for additional 'root' nodes in a file, e.g. helper classes

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

Branch: refs/heads/develop
Commit: 9e5c117242b60dd797d5eb43546221e8e9829393
Parents: 86f0644
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:20:27 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:03 2014 +0100

----------------------------------------------------------------------
 .../internal/codegen/as/ASBlockWalker.java      | 28 +++++++++++++++-----
 1 file changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9e5c1172/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
index 293d8e8..dc1763a 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
@@ -178,14 +178,28 @@ public class ASBlockWalker implements IASBlockVisitor, IASBlockWalker
     public void visitFile(IFileNode node)
     {
         debug("visitFile()");
-        IASNode pnode = node.getChild(0);
-        if (pnode != null)
+        
+        int nodeCount = node.getChildCount();
+        for (int i = 0; i < nodeCount; i++)
         {
-            walk(pnode); // IPackageNode
-        }
-        else
-        {
-
+	        IASNode pnode = node.getChild(i);
+	        
+	        // ToDo (erikdebruin): handle other types of root node, such as when
+	        //                     there is no wrapping Package or Class, like
+	        //                     in mx.core.Version
+	        if (pnode != null && 
+	        	(pnode instanceof IPackageNode || 
+	        	 pnode instanceof IClassNode))
+	        {
+	            walk(pnode);
+	            
+		        if (i < nodeCount - 1)
+		        {
+		        	emitter.writeNewline();
+		        	emitter.writeNewline();
+		        	emitter.writeNewline();
+		        }
+	        }
         }
     }
 


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

Posted by er...@apache.org.
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)


[14/14] git commit: [flex-falcon] [refs/heads/develop] - Added setup HTML to 'fake' the initialization of the application by the Flash Player

Posted by er...@apache.org.
Added setup HTML to 'fake' the initialization of the application by the Flash Player

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

Branch: refs/heads/develop
Commit: 5eee1b1956f4d4e92a8ee43f438711c8ddb9236b
Parents: b602955
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Fri Oct 31 17:40:58 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Oct 31 17:44:04 2014 +0100

----------------------------------------------------------------------
 .../codegen/mxml/vf2js/MXMLVF2JSPublisher.java  | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5eee1b19/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
index 5299df1..3c44bd0 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
@@ -134,7 +134,7 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher implements
     public boolean publish(ProblemQuery problems) throws IOException
     {
         boolean ok = true;
-        boolean subsetGoog = false;
+        boolean subsetGoog = true;
         
         final String intermediateDirPath = outputFolder.getPath();
         final File intermediateDir = new File(intermediateDirPath);
@@ -472,10 +472,10 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher implements
             htmlFile.append("\t<script type=\"text/javascript\" src=\"./library/closure/goog/base.js\"></script>\n");
             htmlFile.append("\t<script type=\"text/javascript\" src=\"./sdk-deps.js\"></script>\n");
             htmlFile.append("\t<script type=\"text/javascript\">\n");
-            htmlFile.append("\t\tgoog.require(");
-            htmlFile.append("'mx.managers.SystemManager'");
-            //htmlFile.append(projectName);
-            htmlFile.append(");\n");
+            //htmlFile.append("\t\tgoog.require('mx.styles.StyleProtoChain');\n");
+            htmlFile.append("\t\tgoog.require('mx.managers.SystemManager');\n");
+            htmlFile.append("\t\tgoog.require('mx.managers.systemClasses.ChildManager');\n");
+            //htmlFile.append("\t\tgoog.require('" + projectName + "');\n");
             htmlFile.append("\t</script>\n");
         }
         else
@@ -493,7 +493,8 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher implements
         htmlFile.append("\t\tfunction init() {\n");
         htmlFile.append("\t\t\tvar /** @type {flash.display.LoaderInfo} */ loaderInfo,\n");
         htmlFile.append("\t\t\t    /** @type {flash.display.Stage} */ stage,\n");
-        htmlFile.append("\t\t\t    /** @type {mx.managers.SystemManager} */ systemManager;\n");
+        htmlFile.append("\t\t\t    /** @type {mx.managers.SystemManager} */ systemManager,\n");
+        htmlFile.append("\t\t\t    /** @type {mx.managers.systemClasses.ChildManager} */ childManager;\n");
         htmlFile.append("\t\t\t\n");
         htmlFile.append("\t\t\tstage = new flash.display.Stage();\n");
         htmlFile.append("\t\t\twindow['apache-flex_stage'] = stage;\n");
@@ -519,6 +520,8 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher implements
         htmlFile.append("\t\t\t	infoObject[\"backgroundImage\"] = '';\n");
         htmlFile.append("\t\t\t	infoObject[\"backgroundSize\"] = '';\n");
         htmlFile.append("\t\t\t	infoObject[\"cdRsls\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"compiledLocales\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"compiledResourceBundleNames\"] = '';\n");
         htmlFile.append("\t\t\t	infoObject[\"currentDomain\"] = new flash.system.ApplicationDomain();\n");
         htmlFile.append("\t\t\t	infoObject[\"fonts\"] = '';\n");
         htmlFile.append("\t\t\t	infoObject[\"frames\"] = '';\n");
@@ -533,6 +536,12 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher implements
         htmlFile.append("\t\t\t	return infoObject;\n");
         htmlFile.append("\t\t\t}\n");
         htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tchildManager = new mx.managers.systemClasses.ChildManager(systemManager);\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tmx.managers.DragManagerImpl.sm = window['apache-flex_system-manager'];\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tmx.core.FlexGlobals.topLevelApplication = {};\n");
+        htmlFile.append("\t\t\t\n");
         htmlFile.append("\t\t\twindow['apache-flex_loaderInfo'].dispatchEvent(new flash.events.Event(flash.events.Event.INIT));\n");
         htmlFile.append("\t\t}\n");
         htmlFile.append("\t</script>\n");


[05/14] git commit: [flex-falcon] [refs/heads/develop] - Various checks for NPE situations not encountered in FlexJS

Posted by er...@apache.org.
Various checks for NPE situations not encountered in FlexJS

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

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

----------------------------------------------------------------------
 .../compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/0734ae47/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 5947783..1ff495c 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
@@ -678,6 +678,9 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
                             && ((FunctionDefinition) nodeDef)
                                     .getFunctionClassification() == IFunctionDefinition.FunctionClassification.LOCAL;
 
+                    if (nodeDef instanceof IParameterDefinition)
+                    	return false;
+                    
                     return !identifierIsLocalFunction;
                 }
             }
@@ -743,7 +746,7 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         boolean emitName = true;
 
         if (nodeDef != null
-                && nodeDef.isStatic())
+                && nodeDef.isStatic() && nodeDef.getParent() != null)
         {
             String sname = nodeDef.getParent().getQualifiedName();
             if (sname.length() > 0)
@@ -930,7 +933,6 @@ public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
         IClassNode cnode = (IClassNode) node
                 .getAncestorOfType(IClassNode.class);
 
-        // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
         if (cnode == null)
             return;