You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2021/12/06 04:14:15 UTC

[royale-compiler] branch develop updated: If something has suppressedExport, also do not emit '@nocollapse'. This seems correct for suppressedExport, and therefore (because Language has suppressedExport) also addresses issue #201

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 74cdb97  If something has suppressedExport, also do not emit '@nocollapse'. This seems correct for suppressedExport, and therefore (because Language has suppressedExport) also addresses issue #201
74cdb97 is described below

commit 74cdb970daccf9d692f2341f9029faeaf2db8203
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon Dec 6 17:13:58 2021 +1300

    If something has suppressedExport, also do not emit '@nocollapse'. This seems correct for suppressedExport, and therefore (because Language has suppressedExport) also addresses issue #201
---
 .../internal/codegen/js/royale/JSRoyaleDocEmitter.java         | 10 ++++++++++
 1 file changed, 10 insertions(+)

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 1e11446..d805eec 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
@@ -575,6 +575,13 @@ public class JSRoyaleDocEmitter extends JSGoogDocEmitter
         }
     }
 
+    private JSSessionModel getModel() {
+        if (emitter instanceof IJSEmitter) {
+            return ((IJSEmitter) emitter).getModel();
+        }
+        return null;
+    }
+
     protected void emitNoCollapse(IDefinitionNode node)
     {
         if (!node.hasModifier(ASModifier.STATIC)
@@ -583,6 +590,9 @@ public class JSRoyaleDocEmitter extends JSGoogDocEmitter
         {
             return;
         }
+        if (getModel() != null) {
+            if (getModel().suppressExports || getModel().suppressedExportNodes.contains(node)) return;
+        }
         //dynamically getting/setting a static field won't
         //work properly if it is collapsed in a release build,
         //even when it has been exported