You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2016/01/12 01:08:19 UTC
[1/2] git commit: [flex-falcon] [refs/heads/develop] - EmitterUtils:
do not write this for functions that are members of a package or a file
Repository: flex-falcon
Updated Branches:
refs/heads/develop 1d404c91b -> 19140007c
EmitterUtils: do not write this for functions that are members of a package or a file
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/7e412ea8
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/7e412ea8
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/7e412ea8
Branch: refs/heads/develop
Commit: 7e412ea8e1efb5f31129e1f3621c12cb44cfb107
Parents: 1d404c9
Author: Josh Tynjala <jo...@apache.org>
Authored: Mon Jan 11 14:59:00 2016 -0800
Committer: Josh Tynjala <jo...@apache.org>
Committed: Mon Jan 11 14:59:00 2016 -0800
----------------------------------------------------------------------
.../internal/codegen/js/utils/EmitterUtils.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7e412ea8/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java
index 9afeb77..471e5b7 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java
@@ -324,9 +324,20 @@ public class EmitterUtils
}
else
{
+ boolean isFileOrPackageMember = false;
+ if(nodeDef instanceof FunctionDefinition)
+ {
+ FunctionClassification classification = ((FunctionDefinition) nodeDef).getFunctionClassification();
+ if(classification == FunctionClassification.FILE_MEMBER ||
+ classification == FunctionClassification.PACKAGE_MEMBER)
+ {
+ isFileOrPackageMember = true;
+ }
+ }
return parentNodeId == ASTNodeID.FunctionCallID
&& !(nodeDef instanceof AccessorDefinition)
- && !identifierIsMemberAccess;
+ && !identifierIsMemberAccess
+ && !isFileOrPackageMember;
}
}
else
[2/2] git commit: [flex-falcon] [refs/heads/develop] -
IdentifierEmitter: fixed issue where package or file members wouldn't have
fully-qualified name
Posted by jo...@apache.org.
IdentifierEmitter: fixed issue where package or file members wouldn't have fully-qualified name
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/19140007
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/19140007
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/19140007
Branch: refs/heads/develop
Commit: 19140007cb4cc3435f61a782b88ff1cd9264abb7
Parents: 7e412ea
Author: Josh Tynjala <jo...@apache.org>
Authored: Mon Jan 11 16:03:45 2016 -0800
Committer: Josh Tynjala <jo...@apache.org>
Committed: Mon Jan 11 16:03:45 2016 -0800
----------------------------------------------------------------------
.../codegen/js/jx/IdentifierEmitter.java | 36 +++++++++-----------
1 file changed, 16 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/19140007/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
index 33033c4..174ae61 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
@@ -130,10 +130,17 @@ public class IdentifierEmitter extends JSSubEmitter implements
// us breakpoint on the node.getName() to make
// sure it is ok to always use the short name in an MAE
String qname = nodeDef.getQualifiedName();
- if (parentNodeId == ASTNodeID.MemberAccessExpressionID)
- write(node.getName());
- else if (nodeDef instanceof TypeDefinitionBase)
- write(getEmitter().formatQualifiedName(qname));
+ if (nodeDef instanceof IVariableDefinition)
+ {
+ IVariableDefinition variable = (IVariableDefinition) nodeDef;
+ VariableClassification classification = variable.getVariableClassification();
+ if (classification == VariableClassification.PACKAGE_MEMBER ||
+ classification == VariableClassification.FILE_MEMBER)
+ {
+ write(getEmitter().formatQualifiedName(qname));
+ return;
+ }
+ }
else if (nodeDef instanceof IFunctionDefinition)
{
IFunctionDefinition func = (IFunctionDefinition) nodeDef;
@@ -142,26 +149,15 @@ public class IdentifierEmitter extends JSSubEmitter implements
classification == FunctionClassification.FILE_MEMBER)
{
write(getEmitter().formatQualifiedName(qname));
- }
- else
- {
- write(qname);
+ return;
}
}
- else if (nodeDef instanceof IVariableDefinition)
+ if (parentNodeId == ASTNodeID.MemberAccessExpressionID)
{
- IVariableDefinition variable = (IVariableDefinition) nodeDef;
- VariableClassification classification = variable.getVariableClassification();
- if (classification == VariableClassification.PACKAGE_MEMBER ||
- classification == VariableClassification.FILE_MEMBER)
- {
- write(getEmitter().formatQualifiedName(qname));
- }
- else
- {
- write(qname);
- }
+ write(node.getName());
}
+ else if (nodeDef instanceof TypeDefinitionBase)
+ write(getEmitter().formatQualifiedName(qname));
else
write(qname);
}