royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-compiler] 03/03: handle cases where we skip generating the defineProps structure
Date Fri, 28 Sep 2018 03:34:59 GMT
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit eb6ea11a31bd3cd34544bf8455eb62a1fb0da118
Author: Alex Harui <aharui@apache.org>
AuthorDate: Thu Sep 27 20:34:11 2018 -0700

    handle cases where we skip generating the defineProps structure
---
 .../compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
index 75de94d..fcf3194 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
@@ -1695,7 +1695,8 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
     }
 
     //--------------------------------------------------------------------------    
-
+    private boolean skippedDefineProps;
+    
     protected void emitPropertyGetterSetters(String cname)
     {
     	int n = 0;
@@ -1708,7 +1709,10 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
         }
     	if (n == 0 && (descriptorTree.size() == 0 ||
     			       descriptorTree.size() == 1 && descriptorTree.get(0).propertySpecifiers.size()
== 0))
+    	{
+    		skippedDefineProps = true;
     		return;
+    	}
     	
     	String formattedCName = formatQualifiedName(cname);
     	
@@ -1767,7 +1771,7 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
             RoyaleJSProject project = (RoyaleJSProject) getMXMLWalker().getProject();
             project.needLanguage = true;
             MXMLDescriptorSpecifier root = descriptorTree.get(0);
-            if (root.propertySpecifiers.size() == 0) 
+            if (root.propertySpecifiers.size() == 0 && skippedDefineProps) 
             	return; // all declarations were primitives
             root.isTopNode = false;
     


Mime
View raw message