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:34 UTC

[royale-compiler] 03/05: ClosureUtils: some forward-looking tweaks to detecting symbols to export (but behavior currently remains the same)

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

    ClosureUtils: some forward-looking tweaks to detecting symbols to export (but behavior currently remains the same)
---
 .../java/org/apache/royale/compiler/utils/ClosureUtils.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 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 78c2ea7..819af3c 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
@@ -173,18 +173,22 @@ public class ClosureUtils
                             boolean isPublic = nsRef instanceof INamespaceDefinition.IPublicNamespaceDefinition;
                             boolean isProtected = nsRef instanceof INamespaceDefinition.IProtectedNamespaceDefinition
                                     || nsRef instanceof INamespaceDefinition.IStaticProtectedNamespaceDefinition;
-                            if (localDef instanceof IFunctionDefinition && !(localDef instanceof IVariableDefinition)
-                                    && localDef.isStatic() && isPublic)
+                            if (localDef instanceof IFunctionDefinition
+                                    && !(localDef instanceof IAccessorDefinition)
+                                    // the next two conditions are temporary
+                                    // and more symbols will be exported in the future
+                                    && localDef.isStatic()
+                                    && isPublic)
                             {
                                 if ((isPublic && exportPublic) || (isProtected && exportProtected))
                                 {
                                     if (isFilePrivate)
                                     {
-                                        filePrivateNames.add(qualifiedName + "." + localDef.getBaseName());
+                                        filePrivateNames.add(qualifiedName + (localDef.isStatic() ? "." : ".prototype.") + localDef.getBaseName());
                                     }
                                     else
                                     {
-                                        symbolsResult.add(qualifiedName + "." + localDef.getBaseName());
+                                        symbolsResult.add(qualifiedName + (localDef.isStatic() ? "." : ".prototype.") + localDef.getBaseName());
                                     }
                                 }
                             }