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:59 UTC
[royale-compiler] 01/02: ClosureUtils: switch to
isPublic/isProtected/isInternal for exports since isProtected is fixed in
commit 273830df1c7fdcc2054bc56b398d61173e9855f0
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)
{