You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/10/11 15:52:55 UTC

[1/2] git commit: [flex-falcon] [refs/heads/develop] - update version number for backup build

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 86644a94b -> a39371679


update version number for backup build


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

Branch: refs/heads/develop
Commit: a39371679665d7052b34fce34d40528d20849260
Parents: cc3183d
Author: Alex Harui <ah...@apache.org>
Authored: Tue Oct 11 08:52:11 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 11 08:52:49 2016 -0700

----------------------------------------------------------------------
 compiler-jx/src/test/build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/a3937167/compiler-jx/src/test/build.xml
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/build.xml b/compiler-jx/src/test/build.xml
index deba9f2..2452b16 100644
--- a/compiler-jx/src/test/build.xml
+++ b/compiler-jx/src/test/build.xml
@@ -184,7 +184,7 @@
             value="true" />
     </target>
     <target name="get_asjs" unless="asjs.ok" >
-        <get src="http://apacheflexbuild.cloudapp.net:8080/job/flex-asjs/lastSuccessfulBuild/artifact/out/apache-flex-flexjs-0.7.0-bin.zip" dest="${compiler}/target/junit-temp/flexjs.zip"/>
+        <get src="http://apacheflexbuild.cloudapp.net:8080/job/flex-asjs/lastSuccessfulBuild/artifact/out/apache-flex-flexjs-0.8.0-bin.zip" dest="${compiler}/target/junit-temp/flexjs.zip"/>
         <unzip src="${compiler}/target/junit-temp/flexjs.zip" dest="${env.ASJS_HOME}">
             <patternset>
                 <include name="frameworks/libs/*.swc"/>


[2/2] git commit: [flex-falcon] [refs/heads/develop] - hack in support for force-linking via import foo.bar.baz; baz

Posted by ah...@apache.org.
hack in support for force-linking via import foo.bar.baz; baz


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

Branch: refs/heads/develop
Commit: cc3183d18311137e1705d89ee9dca69f2a013068
Parents: 86644a9
Author: Alex Harui <ah...@apache.org>
Authored: Mon Oct 10 14:46:23 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 11 08:52:49 2016 -0700

----------------------------------------------------------------------
 .../internal/codegen/js/jx/ClassEmitter.java    | 35 ++++++++++++++++++++
 .../codegen/js/flexjs/TestFlexJSClass.java      | 16 +++++----
 2 files changed, 44 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/cc3183d1/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
index 0a37cf4..d629b5d 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
@@ -28,9 +28,12 @@ import org.apache.flex.compiler.definitions.IFunctionDefinition;
 import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
 import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.utils.DocEmitterUtils;
 import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
 import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
 import org.apache.flex.compiler.tree.as.IAccessorNode;
 import org.apache.flex.compiler.tree.as.IClassNode;
 import org.apache.flex.compiler.tree.as.IDefinitionNode;
@@ -65,6 +68,38 @@ public class ClassEmitter extends JSSubEmitter implements
 
         IFunctionDefinition ctorDefinition = definition.getConstructor();
 
+        // look for force-linking pattern in scope block node
+        int childNodeCount = node.getChildCount();
+        for (int i = 0; i < childNodeCount; i++)
+        {
+        	IASNode child = node.getChild(i);
+        	if (child.getNodeID() == ASTNodeID.BlockID)
+        	{
+        		int blockNodeCount = child.getChildCount();
+        		for (int j = 0; j < blockNodeCount - 1; j++)
+        		{
+        			IASNode blockChild = child.getChild(j);
+        			if (blockChild.getNodeID() == ASTNodeID.ImportID)
+        			{
+        				IASNode afterChild = child.getChild(j + 1);
+        				if (afterChild.getNodeID() == ASTNodeID.IdentifierID)
+        				{
+                            write(JSGoogEmitterTokens.GOOG_REQUIRE);
+                            write(ASEmitterTokens.PAREN_OPEN);
+                            write(ASEmitterTokens.SINGLE_QUOTE);
+                            getEmitter().emitIdentifier((IdentifierNode)afterChild);                            
+                            write(ASEmitterTokens.SINGLE_QUOTE);
+                            write(ASEmitterTokens.PAREN_CLOSE);
+                            writeNewline(ASEmitterTokens.SEMICOLON);
+                            writeNewline();
+                            writeNewline();
+        				}
+        			}
+        		}
+        		break;
+        	}        	
+        }
+        
         // Static-only (Singleton) classes may not have a constructor
         if (ctorDefinition != null)
         {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/cc3183d1/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
index 8b91070..a28583e 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
@@ -23,6 +23,7 @@ import org.apache.flex.compiler.driver.IBackend;
 import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogClass;
 import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
 import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.FileNode;
 import org.apache.flex.compiler.tree.as.IClassNode;
 import org.junit.Test;
 
@@ -31,13 +32,6 @@ import org.junit.Test;
  */
 public class TestFlexJSClass extends TestGoogClass
 {
-	// TODO: aharui Use cinit() to initialize statics
-	//         private static var foo:Boolean = someStaticMethodToFollow();
-	//         private static function someStaticMethodToFollow():Boolean {};
-
-	// TODO: aharui Use cinit() to handle force-linking
-	//         import somePackage.someClass; someClass;
-
     @Override
     public void setUp()
     {
@@ -233,6 +227,14 @@ public class TestFlexJSClass extends TestGoogClass
         assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @export\n * @type {number}\n */\norg.apache.flex.A.a = 10;\n\n\n/**\n * @export\n * @type {string}\n */\norg.apache.flex.A.b;\n\n\n/**\n * @private\n * @return {string}\n */\norg.apache.flex.A.initStatic = function() {\n  return \"foo\";\n};\n\n\norg.apache.flex.A.b = org.apache.flex.A.initStatic();");
     }
     
+    @Test
+    public void testImportForceLinkingAsStaticInitializers()
+    {
+        FileNode node = (FileNode)getNode("package org.apache.flex {\npublic class A {\nimport flash.display.Sprite; Sprite;\n}}", FileNode.class, 0);
+        asBlockWalker.visitFile(node);
+        assertOut("/**\n * org.apache.flex.A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n */\n\ngoog.provide('org.apache.flex.A');\n\n\n\ngoog.require('flash.display.Sprite');\n\n\n/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+    
     @Override
     @Test
     public void testConstants()