flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [1/4] git commit: [flex-falcon] [refs/heads/feature/maven-migration] - fix static function initializers
Date Tue, 29 Mar 2016 14:33:38 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/feature/maven-migration 9620315b6 -> 9759a0bca


fix static function initializers


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

Branch: refs/heads/feature/maven-migration
Commit: 74aebf34c26d0fa6b1ef83b6bdf36b3b813932e6
Parents: 20b3a66
Author: Alex Harui <aharui@apache.org>
Authored: Sun Mar 27 23:18:14 2016 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Sun Mar 27 23:18:27 2016 -0700

----------------------------------------------------------------------
 .../internal/codegen/js/flexjs/TestFlexJSFieldMembers.java  | 9 +++++++++
 .../internal/codegen/js/flexjs/JSFlexJSEmitter.java         | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/74aebf34/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
index fb390ff..0859a7b 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
@@ -180,6 +180,15 @@ public class TestFlexJSFieldMembers extends TestGoogFieldMembers
         assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\nthis.foo = parseFloat('1E2');\n};\n\n\n/**\n
* @protected\n * @type {number}\n */\nFalconTest_A.prototype.foo;");
     }
     
+    @Test
+    public void testStaticField_withFunctionInitializer()
+    {
+    	IClassNode node = (IClassNode) getNode("private static var empty:Function = function():void
{}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n
* @private\n * @type {Function}\n */\nFalconTest_A.empty = function() {\n};");
+    }
+    
     @Override
     @Test
     public void testField_withList()

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/74aebf34/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
index c4c72da..92a722a 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -292,7 +292,7 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     public void emitFunctionObject(IFunctionObjectNode node)
     {
 		IFunctionNode fnNode = (IFunctionNode)node.getAncestorOfType(IFunctionNode.class);
-    	if (fnNode.getEmittingLocalFunctions())
+    	if (fnNode == null || fnNode.getEmittingLocalFunctions())
     	{
     		super.emitFunctionObject(node);
     	}


Mime
View raw message