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 2021/12/27 07:42:30 UTC

[royale-compiler] branch develop updated (363efd1 -> ebf3137)

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

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


    from 363efd1  MemberAccessEmitter: improved detection of XMLish expressions to determine if dynamic-access-unknown-members is necessary (references #203)
     new 3ccebe5  ignore disabled conditional compilation blocks
     new ebf3137  add HtmlSanitizer to the list of goog files that are added to output

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:
 .../internal/codegen/js/utils/EmitterUtils.java    | 11 +++++----
 .../codegen/mxml/royale/MXMLRoyalePublisher.java   | 27 ++++++++++++----------
 .../internal/tree/as/ConfigConditionBlockNode.java |  5 ++++
 3 files changed, 27 insertions(+), 16 deletions(-)

[royale-compiler] 02/02: add HtmlSanitizer to the list of goog files that are added to output

Posted by ah...@apache.org.
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 ebf3137416dc20615288f03b5e42e3f20f9d891c
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sun Dec 26 23:42:06 2021 -0800

    add HtmlSanitizer to the list of goog files that are added to output
---
 .../codegen/mxml/royale/MXMLRoyalePublisher.java   | 27 ++++++++++++----------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java
index 523f55c..14d251d 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java
@@ -391,7 +391,10 @@ public class MXMLRoyalePublisher extends JSGoogPublisher implements IJSGoogPubli
             FileUtils.write(new File(new File(intermediateDir, "library/closure"),
                     closureSourceFile.getName()), closureSourceFile.getCode(), Charset.forName("utf8"));
         }
-        closureSourceFiles = closureFilesInOrder(intermediateDir + "/library/closure/", closureSourceFiles, "goog.events.EventTarget");
+        List<String> closureEntryPoints = new ArrayList<String>();
+        closureEntryPoints.add("goog.events.EventTarget");
+        closureEntryPoints.add("goog.html.sanitizer.HtmlSanitizer");
+        closureSourceFiles = closureFilesInOrder(intermediateDir + "/library/closure/", closureSourceFiles, closureEntryPoints);
 
 
         /////////////////////////////////////////////////////////////////////////////////
@@ -618,7 +621,7 @@ public class MXMLRoyalePublisher extends JSGoogPublisher implements IJSGoogPubli
         return true;
     }
 
-    protected List<SourceFile> closureFilesInOrder(String path, List<SourceFile> files, String entryPoint)
+    protected List<SourceFile> closureFilesInOrder(String path, List<SourceFile> files, List<String> entryPoints)
     {
     	ArrayList<String> sortedFiles = new ArrayList<String>();
     	HashMap<String, SourceFile> fileMap = new HashMap<String, SourceFile>();
@@ -657,7 +660,7 @@ public class MXMLRoyalePublisher extends JSGoogPublisher implements IJSGoogPubli
             // nothing to see, move along...
         }
 
-        sortClosureFile(deps, entryPoint, sortedFiles);
+        sortClosureFile(deps, entryPoints, sortedFiles);
         
         ArrayList<SourceFile> list = new ArrayList<SourceFile>();
         ArrayList<String> seen = new ArrayList<String>();
@@ -763,16 +766,16 @@ public class MXMLRoyalePublisher extends JSGoogPublisher implements IJSGoogPubli
         }
     }
     
-    private void sortClosureFile(List<String> deps, String entryPoint, List<String> sortedFiles)
+    private void sortClosureFile(List<String> deps, List<String> entryPoints, List<String> sortedFiles)
     {
-    	String provided = getProvidedFile(deps, entryPoint);
-        sortedFiles.add(provided);
-        List<String> reqs = getRequires(deps, entryPoint);
-        if (reqs == null) return;
-        for (String req : reqs)
-        {
-        	sortClosureFile(deps, req, sortedFiles);
-        }
+    	for (String entryPoint : entryPoints)
+    	{
+        	String provided = getProvidedFile(deps, entryPoint);
+            sortedFiles.add(provided);
+            List<String> reqs = getRequires(deps, entryPoint);
+            if (reqs != null)
+            	sortClosureFile(deps, reqs, sortedFiles);
+    	}
     }
     
     private String getProvidedFile(List<String> deps, String name)

[royale-compiler] 01/02: ignore disabled conditional compilation blocks

Posted by ah...@apache.org.
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 3ccebe5cb71c0bf0d7f313c2e88fc340a622aafa
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sun Dec 26 23:35:05 2021 -0800

    ignore disabled conditional compilation blocks
---
 .../compiler/internal/codegen/js/utils/EmitterUtils.java      | 11 +++++++----
 .../compiler/internal/tree/as/ConfigConditionBlockNode.java   |  5 +++++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
index c260963..17e0474 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
@@ -71,11 +71,14 @@ public class EmitterUtils
             else if (child.getNodeID() == ASTNodeID.ConfigBlockID)
             {
             	ConfigConditionBlockNode configNode = (ConfigConditionBlockNode)child;
-            	if (configNode.getChildCount() > 0)
+            	if (configNode.getEnabled() && configNode.getChildCount() > 0)
             	{
-            		child = configNode.getChild(0);
-                    if (child instanceof ITypeNode)
-                        return (ITypeNode) child;
+            		for (int j = 0; j < configNode.getChildCount(); j++)
+            		{
+                		child = configNode.getChild(j);
+                        if (child instanceof ITypeNode)
+                            return (ITypeNode) child;            			
+            		}
             	}
             }
         }
diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/ConfigConditionBlockNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/ConfigConditionBlockNode.java
index c0998f4..9724dd3 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/ConfigConditionBlockNode.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/ConfigConditionBlockNode.java
@@ -47,6 +47,11 @@ public final class ConfigConditionBlockNode extends BlockNode
         this.setContainerType(ContainerType.CONFIG_BLOCK);
     }
 
+    public boolean getEnabled()
+    {
+    	return this.enabled;
+    }
+    
     /**
      * Disabled configuration condition block doesn't have children.
      */