You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/10/11 08:59:50 UTC

[royale-compiler] branch develop updated: try to fix TDF

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


The following commit(s) were added to refs/heads/develop by this push:
     new 4d82934  try to fix TDF
4d82934 is described below

commit 4d829342acc17f7d31b1e1be0a206858a5c05007
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Oct 11 01:59:12 2018 -0700

    try to fix TDF
---
 .../internal/tree/mxml/MXMLPropertySpecifierNode.java         | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
index e27713a..853a259 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
@@ -365,12 +365,18 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
         
         int numChildTags = 0;
         IMXMLTagData oneAndOnlyChildTag = null;
+    	boolean childrenAreClasses = true;
     	for (IMXMLUnitData unit : contentUnits)
     	{
     		if (unit instanceof IMXMLTagData)
     		{
     			oneAndOnlyChildTag = (IMXMLTagData)unit;
     			numChildTags++;
+                IDefinition definition = builder.getFileScope().resolveTagToDefinition(oneAndOnlyChildTag);
+                if (!(definition instanceof ClassDefinition))
+                {
+                	childrenAreClasses = false;
+                }
     		}
     	}
     	boolean oneAndOnlyChildIsClass = false;
@@ -390,8 +396,9 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
             ((MXMLDeferredInstanceNode)instanceNode).initializeDefaultProperty(
                     builder, defaultPropertyDefinition, contentUnits);
         }
-        else if (propertyTypeName.equals(IASLanguageConstants.Array) && 
-                oneChildIsNotArray(builder, contentUnits))
+        else if ((propertyTypeName.equals(IASLanguageConstants.Array) && 
+                oneChildIsNotArray(builder, contentUnits)) ||
+                (propertyTypeName.equals(IASLanguageConstants.Object) && childrenAreClasses && !oneAndOnlyChildIsClass))
         {
             // Create an implicit array node.
             instanceNode = new MXMLArrayNode(this);