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/05/26 21:40:33 UTC

[royale-compiler] 02/05: JSRoyaleDocEmitter: updates emitExports and exportProtected more accurately when config is missing and for fields

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 de570f74f36877c1fbdab10c582d62951c38beb6
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue May 26 12:42:57 2020 -0700

    JSRoyaleDocEmitter: updates emitExports and exportProtected more accurately when config is missing and for fields
---
 .../codegen/js/royale/JSRoyaleDocEmitter.java      | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

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 305a950..ad57c68 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
@@ -140,6 +140,11 @@ public class JSRoyaleDocEmitter extends JSGoogDocEmitter
         	emitExports = !suppressExports && fjp.config.getExportPublicSymbols();
         	exportProtected = !suppressExports && fjp.config.getExportProtectedSymbols();
         }
+        else
+        {
+            emitExports = !suppressExports;
+            exportProtected = false;
+        }
         
         coercionList = null;
         ignoreList = null;
@@ -544,9 +549,24 @@ public class JSRoyaleDocEmitter extends JSGoogDocEmitter
     @Override
     public void emitFieldDoc(IVariableNode node, IDefinition def, ICompilerProject project)
     {
+        RoyaleJSProject fjp =  (RoyaleJSProject)project;
+        boolean suppressExports = false;
+        if (emitter instanceof JSRoyaleEmitter) {
+            suppressExports = ((JSRoyaleEmitter) emitter).getModel().suppressExports;
+        }
+        if (fjp.config != null)
+        {
+        	emitExports = !suppressExports && fjp.config.getExportPublicSymbols();
+        	exportProtected = !suppressExports && fjp.config.getExportProtectedSymbols();
+        }
+        else
+        {
+            emitExports = !suppressExports;
+            exportProtected = false;
+        }
+
         begin();
 
-        RoyaleJSProject fjp =  (RoyaleJSProject)project;
         String ns = node.getNamespace();
         if (ns == IASKeywordConstants.PRIVATE)
         {