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 2020/07/28 20:07:58 UTC

[royale-compiler] branch develop updated (b999066 -> 06eaef9)

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 b999066  AccessorEmitter: now adds export annotations for protected and internal, if the compiler options are enabled
     new dab9ef8  ClosureUtils: switch to isPublic/isProtected/isInternal for exports since isProtected is fixed in commit 273830df1c7fdcc2054bc56b398d61173e9855f0
     new 06eaef9  ClosureUtils: dynamically export protected/internal methods in release builds instead of using export annotation in emitter

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:
 .../codegen/js/royale/JSRoyaleDocEmitter.java      |  7 ++---
 .../apache/royale/compiler/utils/ClosureUtils.java | 33 ++++++++--------------
 2 files changed, 14 insertions(+), 26 deletions(-)


[royale-compiler] 01/02: ClosureUtils: switch to isPublic/isProtected/isInternal for exports since isProtected is fixed in commit 273830df1c7fdcc2054bc56b398d61173e9855f0

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 dab9ef82606d8b2900107154a7258829af0526c1
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue Jul 28 12:11:40 2020 -0700

    ClosureUtils: switch to isPublic/isProtected/isInternal for exports since isProtected is fixed in commit 273830df1c7fdcc2054bc56b398d61173e9855f0
---
 .../apache/royale/compiler/utils/ClosureUtils.java | 32 +++++++---------------
 1 file changed, 10 insertions(+), 22 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/utils/ClosureUtils.java b/compiler-jx/src/main/java/org/apache/royale/compiler/utils/ClosureUtils.java
index 41e94e9..2def2d6 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/utils/ClosureUtils.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/utils/ClosureUtils.java
@@ -92,22 +92,15 @@ public class ClosureUtils
                             {
                                 continue;
                             }
-                            INamespaceReference nsRef = localDef.getNamespaceReference();
-                            boolean isPublic = nsRef instanceof INamespaceDefinition.IPublicNamespaceDefinition;
-                            boolean isProtected = nsRef instanceof INamespaceDefinition.IProtectedNamespaceDefinition
-                                    || nsRef instanceof INamespaceDefinition.IStaticProtectedNamespaceDefinition;
-                            boolean isInternal = nsRef instanceof INamespaceDefinition.IInternalNamespaceDefinition;
-                            
-                            if ((isPublic && preventRenamePublic)
-                                    || (isProtected && preventRenameProtected)
-                                    || (isInternal && preventRenameInternal))
+                            if ((localDef.isPublic() && preventRenamePublic)
+                                    || (localDef.isProtected() && preventRenameProtected)
+                                    || (localDef.isInternal() && preventRenameInternal))
                             {
                                 if (localDef instanceof IAccessorDefinition)
                                 {
-                                    /* disabled temporarily until AccessorEmitter handles @export
-                                        (isProtected && exportProtected)
-                                        (isInternal && exportInternal) */
-                                    if ((isPublic && exportPublic))
+                                    if ((localDef.isPublic() && exportPublic)
+                                            || (localDef.isProtected() && exportProtected)
+                                            || (localDef.isInternal() && exportInternal))
                                     {
                                         //if an accessor is exported, we don't
                                         //need to prevent renaming
@@ -191,20 +184,15 @@ public class ClosureUtils
                             {
                                 continue;
                             }
-                            INamespaceReference nsRef = localDef.getNamespaceReference();
-                            boolean isPublic = nsRef instanceof INamespaceDefinition.IPublicNamespaceDefinition;
-                            boolean isProtected = nsRef instanceof INamespaceDefinition.IProtectedNamespaceDefinition
-                                    || nsRef instanceof INamespaceDefinition.IStaticProtectedNamespaceDefinition;
-                            boolean isInternal = nsRef instanceof INamespaceDefinition.IInternalNamespaceDefinition;
                             if (localDef instanceof IFunctionDefinition
                                     && !(localDef instanceof IAccessorDefinition)
                                     // the next condition is temporary, and more
                                     // symbols will be exported in the future
-                                    && isPublic)
+                                    && localDef.isPublic())
                             {
-                                if ((isPublic && exportPublic)
-                                        || (isProtected && exportProtected)
-                                        || (isInternal && exportInternal))
+                                if ((localDef.isPublic() && exportPublic)
+                                        || (localDef.isProtected() && exportProtected)
+                                        || (localDef.isInternal() && exportInternal))
                                 {
                                     if (isFilePrivate)
                                     {


[royale-compiler] 02/02: ClosureUtils: dynamically export protected/internal methods in release builds instead of using export annotation in emitter

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 06eaef92a9514f59ca8d3751363fb25458759a2f
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue Jul 28 12:53:15 2020 -0700

    ClosureUtils: dynamically export protected/internal methods in release builds instead of using export annotation in emitter
    
    This works the same as public methods, as already implemented previous commits. Just expanding it to more symbols.
---
 .../compiler/internal/codegen/js/royale/JSRoyaleDocEmitter.java    | 7 +++----
 .../main/java/org/apache/royale/compiler/utils/ClosureUtils.java   | 3 ++-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleDocEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleDocEmitter.java
index 070edbf..fb4188f 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleDocEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleDocEmitter.java
@@ -138,17 +138,16 @@ public class JSRoyaleDocEmitter extends JSGoogDocEmitter
         if (emitter instanceof JSRoyaleEmitter) {
             suppressExports = ((JSRoyaleEmitter) emitter).getModel().suppressExports;
         }
+        //exporting is handled dynamically in ClosureUtils
+        exportProtected = false;
+        exportInternal = false;
         if (fjp.config != null)
         {
         	emitExports = !suppressExports && fjp.config.getExportPublicSymbols();
-        	exportProtected = !suppressExports && fjp.config.getExportProtectedSymbols();
-        	exportInternal = !suppressExports && fjp.config.getExportInternalSymbols();
         }
         else
         {
             emitExports = !suppressExports;
-            exportProtected = false;
-            exportInternal = false;
         }
         if (node.getAncestorOfType(IClassNode.class) != null)
         {
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/utils/ClosureUtils.java b/compiler-jx/src/main/java/org/apache/royale/compiler/utils/ClosureUtils.java
index 2def2d6..8a11ee8 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/utils/ClosureUtils.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/utils/ClosureUtils.java
@@ -188,9 +188,10 @@ public class ClosureUtils
                                     && !(localDef instanceof IAccessorDefinition)
                                     // the next condition is temporary, and more
                                     // symbols will be exported in the future
-                                    && localDef.isPublic())
+                                    && localDef.getNamespaceReference().isLanguageNamespace())
                             {
                                 if ((localDef.isPublic() && exportPublic)
+                                        || (!localDef.getNamespaceReference().isLanguageNamespace() && exportPublic)
                                         || (localDef.isProtected() && exportProtected)
                                         || (localDef.isInternal() && exportInternal))
                                 {