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:08:00 UTC

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

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))
                                 {