You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2021/01/14 22:17:54 UTC

[royale-compiler] branch develop updated (241b324 -> 9f1c59a)

This is an automated email from the ASF dual-hosted git repository.

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


    from 241b324  fix dispatcher variable initialization: use the staticEventDispatcher getter function instead of the _bindingEventDispatcher underlying variable, which is never initialized. (#175)
     new c699a92  compiler: fix issue where using the MXML 2009 namespace with any tag name (including classes that don't exist) was allowed without error
     new 9f1c59a  royale.dependent.tests: fix missing MXML 2009 manifest

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../compiler/internal/test/RoyaleTestBase.java     | 13 +++++++++++++
 .../compiler/internal/tree/mxml/MXMLArrayNode.java | 19 +++----------------
 .../internal/tree/mxml/MXMLDeclarationsNode.java   | 22 ++++------------------
 .../tree/mxml/MXMLPropertySpecifierNode.java       | 17 +++--------------
 .../internal/tree/mxml/MXMLVectorNode.java         |  5 ++++-
 compiler/src/test/resources/mxml-2009-manifest.xml |  2 +-
 6 files changed, 28 insertions(+), 50 deletions(-)


[royale-compiler] 02/02: royale.dependent.tests: fix missing MXML 2009 manifest

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9f1c59a7a95cd2c283217f372df3bea20bf13331
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Thu Jan 14 13:37:20 2021 -0800

    royale.dependent.tests: fix missing MXML 2009 manifest
---
 .../royale/compiler/internal/test/RoyaleTestBase.java       | 13 +++++++++++++
 compiler/src/test/resources/mxml-2009-manifest.xml          |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/test/RoyaleTestBase.java b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/test/RoyaleTestBase.java
index cf25d58..e3a7a59 100644
--- a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/test/RoyaleTestBase.java
+++ b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/test/RoyaleTestBase.java
@@ -26,7 +26,9 @@ import java.util.List;
 import org.apache.royale.compiler.driver.IBackend;
 import org.apache.royale.compiler.internal.as.codegen.BindableHelper;
 import org.apache.royale.compiler.internal.driver.mxml.royale.MXMLRoyaleBackend;
+import org.apache.royale.compiler.internal.mxml.MXMLNamespaceMapping;
 import org.apache.royale.compiler.internal.projects.RoyaleJSProject;
+import org.apache.royale.compiler.mxml.IMXMLNamespaceMapping;
 import org.apache.royale.compiler.tree.as.IASNode;
 import org.apache.royale.compiler.tree.mxml.IMXMLFileNode;
 import org.apache.royale.compiler.tree.mxml.IMXMLNode;
@@ -59,6 +61,17 @@ public class RoyaleTestBase extends TestBase
     }
 
     @Override
+    protected void addNamespaceMappings(
+            List<IMXMLNamespaceMapping> namespaceMappings)
+    {
+        namespaceMappings.add(new MXMLNamespaceMapping(
+                "http://ns.adobe.com/mxml/2009",
+                FilenameNormalization.normalize("../compiler/src/test/resources/mxml-2009-manifest.xml")));
+
+        super.addNamespaceMappings(namespaceMappings);
+    }
+
+    @Override
     protected void addLibraries(List<File> libraries)
     {
         libraries.add(new File(FilenameNormalization.normalize(env.FPSDK
diff --git a/compiler/src/test/resources/mxml-2009-manifest.xml b/compiler/src/test/resources/mxml-2009-manifest.xml
index 9795445..cf5b013 100644
--- a/compiler/src/test/resources/mxml-2009-manifest.xml
+++ b/compiler/src/test/resources/mxml-2009-manifest.xml
@@ -37,7 +37,7 @@
     <component id="RegExp" class="RegExp" lookupOnly="true"/>
     <component id="String" class="String" lookupOnly="true"/>
     <component id="uint" class="uint" lookupOnly="true"/>
-	<component id="Vector" class="__AS3__.vec.Vector" lookupOnly="true"/>
+    <component id="Vector" class="__AS3__.vec.Vector" lookupOnly="true"/>
     <component id="XML" class="XML" lookupOnly="true"/>
     <component id="XMLList" class="XMLList" lookupOnly="true"/>
 


[royale-compiler] 01/02: compiler: fix issue where using the MXML 2009 namespace with any tag name (including classes that don't exist) was allowed without error

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c699a92f3486995124ff10dcb5750ee689a358bc
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Thu Jan 14 10:38:41 2021 -0800

    compiler: fix issue where using the MXML 2009 namespace with any tag name (including classes that don't exist) was allowed without error
    
    This seemed to be caused by a workaround for a separate issue that doesn't appear to be present anymore. Real MXML 2009 classes are resolving correctly without the workaround.
---
 .../compiler/internal/tree/mxml/MXMLArrayNode.java | 19 +++----------------
 .../internal/tree/mxml/MXMLDeclarationsNode.java   | 22 ++++------------------
 .../tree/mxml/MXMLPropertySpecifierNode.java       | 17 +++--------------
 .../internal/tree/mxml/MXMLVectorNode.java         |  5 ++++-
 4 files changed, 14 insertions(+), 49 deletions(-)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLArrayNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLArrayNode.java
index af2ec7e..6930281 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLArrayNode.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLArrayNode.java
@@ -30,13 +30,11 @@ import org.apache.royale.compiler.definitions.IClassDefinition;
 import org.apache.royale.compiler.definitions.IDefinition;
 import org.apache.royale.compiler.definitions.ITypeDefinition;
 import org.apache.royale.compiler.definitions.IVariableDefinition;
-import org.apache.royale.compiler.internal.definitions.ClassDefinition;
 import org.apache.royale.compiler.internal.mxml.MXMLDialect.TextParsingFlags;
 import org.apache.royale.compiler.internal.parsing.ISourceFragment;
 import org.apache.royale.compiler.internal.parsing.SourceFragmentsReader;
 import org.apache.royale.compiler.internal.projects.RoyaleProject;
 import org.apache.royale.compiler.internal.tree.as.NodeBase;
-import org.apache.royale.compiler.mxml.IMXMLLanguageConstants;
 import org.apache.royale.compiler.mxml.IMXMLTagData;
 import org.apache.royale.compiler.mxml.IMXMLTextData;
 import org.apache.royale.compiler.mxml.IMXMLUnitData;
@@ -160,20 +158,9 @@ class MXMLArrayNode extends MXMLInstanceNode implements IMXMLArrayNode
         }
         else
         {
-            String uri = childTag.getURI();
-            if (uri != null && uri.equals(IMXMLLanguageConstants.NAMESPACE_MXML_2009))
-            {
-                MXMLInstanceNode instanceNode = MXMLInstanceNode.createInstanceNode(
-                        builder, childTag.getShortName(), this);
-                instanceNode.setClassReference(project, childTag.getShortName());
-                instanceNode.initializeFromTag(builder, childTag);
-                info.addChildNode(instanceNode);
-            }
-            else
-            {
-                builder.addProblem(new MXMLUnresolvedTagProblem(childTag));
-                return;
-            }
+            MXMLUnresolvedTagProblem problem = new MXMLUnresolvedTagProblem(childTag);
+            builder.addProblem(problem);
+            return;
         }
     }
 
diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDeclarationsNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDeclarationsNode.java
index f38b1d0..caa9dc2 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDeclarationsNode.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDeclarationsNode.java
@@ -19,7 +19,6 @@
 
 package org.apache.royale.compiler.internal.tree.mxml;
 
-import org.apache.royale.compiler.constants.IASLanguageConstants;
 import org.apache.royale.compiler.definitions.IClassDefinition;
 import org.apache.royale.compiler.definitions.IDefinition;
 import org.apache.royale.compiler.internal.definitions.ClassDefinition;
@@ -28,6 +27,7 @@ import org.apache.royale.compiler.internal.scopes.MXMLFileScope;
 import org.apache.royale.compiler.internal.tree.as.NodeBase;
 import org.apache.royale.compiler.mxml.IMXMLLanguageConstants;
 import org.apache.royale.compiler.mxml.IMXMLTagData;
+import org.apache.royale.compiler.problems.MXMLUnresolvedTagProblem;
 import org.apache.royale.compiler.tree.ASTNodeID;
 import org.apache.royale.compiler.tree.as.IASNode;
 import org.apache.royale.compiler.tree.mxml.IMXMLDeclarationsNode;
@@ -90,23 +90,9 @@ class MXMLDeclarationsNode extends MXMLNodeBase implements IMXMLDeclarationsNode
             }
             else 
             {
-                String uri = childTag.getURI();
-                if (uri != null && uri.equals(IMXMLLanguageConstants.NAMESPACE_MXML_2009))
-                {
-                    String shortName = childTag.getShortName();
-                    // for some reason, the factory is looking for the full qname
-                    if (shortName.equals(IASLanguageConstants.Vector))
-                        shortName = IASLanguageConstants.Vector_qname;
-                    MXMLInstanceNode instanceNode = MXMLInstanceNode.createInstanceNode(
-                            builder, shortName, this);
-                    instanceNode.setClassReference(project, childTag.getShortName());
-                    instanceNode.initializeFromTag(builder, childTag);
-                    info.addChildNode(instanceNode);
-                }
-                else
-                {
-                    super.processChildTag(builder, tag, childTag, info);
-                }
+                MXMLUnresolvedTagProblem problem = new MXMLUnresolvedTagProblem(childTag);
+                builder.addProblem(problem);
+                return;
             }
         }
     }
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 f36dc16..89925e7 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
@@ -47,7 +47,6 @@ import org.apache.royale.compiler.internal.scopes.ASScope;
 import org.apache.royale.compiler.internal.scopes.MXMLFileScope;
 import org.apache.royale.compiler.internal.scopes.TypeScope;
 import org.apache.royale.compiler.internal.tree.as.NodeBase;
-import org.apache.royale.compiler.mxml.IMXMLLanguageConstants;
 import org.apache.royale.compiler.mxml.IMXMLTagAttributeData;
 import org.apache.royale.compiler.mxml.IMXMLTagData;
 import org.apache.royale.compiler.mxml.IMXMLTextData;
@@ -527,19 +526,9 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
                 }
                 else
                 {
-                    String uri = childTag.getURI();
-                    if (uri != null && uri.equals(IMXMLLanguageConstants.NAMESPACE_MXML_2009))
-                    {
-                        instanceNode = MXMLInstanceNode.createInstanceNode(
-                                builder, childTag.getShortName(), this);
-                        instanceNode.setClassReference(project, childTag.getShortName());
-                        instanceNode.initializeFromTag(builder, childTag);
-                    }
-                    else
-                    {
-                        ICompilerProblem problem = new MXMLUnresolvedTagProblem(childTag);
-                        builder.addProblem(problem);
-                    }
+                    MXMLUnresolvedTagProblem problem = new MXMLUnresolvedTagProblem(childTag);
+                    builder.addProblem(problem);
+                    return;
                 }
             }
 
diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLVectorNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLVectorNode.java
index 19db659..b072549 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLVectorNode.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLVectorNode.java
@@ -27,6 +27,7 @@ import org.apache.royale.compiler.problems.MXMLIncompatibleVectorElementProblem;
 import org.apache.royale.compiler.problems.MXMLInvalidVectorFixedAttributeProblem;
 import org.apache.royale.compiler.problems.MXMLInvalidVectorTypeAttributeProblem;
 import org.apache.royale.compiler.problems.MXMLMissingVectorTypeAttributeProblem;
+import org.apache.royale.compiler.problems.MXMLUnresolvedTagProblem;
 import org.apache.royale.compiler.projects.ICompilerProject;
 import org.apache.royale.compiler.common.DependencyType;
 import org.apache.royale.compiler.constants.IASLanguageConstants;
@@ -220,7 +221,9 @@ class MXMLVectorNode extends MXMLInstanceNode implements IMXMLVectorNode
         }
         else
         {
-            super.processChildTag(builder, tag, childTag, info);
+            MXMLUnresolvedTagProblem problem = new MXMLUnresolvedTagProblem(childTag);
+            builder.addProblem(problem);
+            return;
         }
     }