flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/3] git commit: [flex-falcon] [refs/heads/develop] - try to force an undefined member error. With this change you get that, plus a duplicate error claiming the missing property is missing on the class def instead of the missing member's supposed insta
Date Fri, 13 Nov 2015 20:03:19 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 6b74cd0eb -> 63ffe0fc8


try to force an undefined member error.  With this change you get that, plus a duplicate error
claiming the missing property is missing on the class def instead of the missing member's
supposed instance.


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/9f24eba6
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/9f24eba6
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/9f24eba6

Branch: refs/heads/develop
Commit: 9f24eba694d3a8b1316525bf7b6275269e6fbd17
Parents: 6b74cd0
Author: Alex Harui <aharui@apache.org>
Authored: Fri Nov 13 10:51:22 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Nov 13 10:51:22 2015 -0800

----------------------------------------------------------------------
 .../internal/tree/as/IdentifierNode.java        | 22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9f24eba6/compiler/src/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
index 2b153fb..95ab0c3 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
@@ -60,6 +60,7 @@ import org.apache.flex.compiler.internal.tree.as.metadata.MetaTagsNode;
 import org.apache.flex.compiler.internal.tree.as.metadata.StyleTagNode;
 import org.apache.flex.compiler.internal.workspaces.Workspace;
 import org.apache.flex.compiler.parsing.IASToken;
+import org.apache.flex.compiler.problems.AccessUndefinedMemberProblem;
 import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.tree.ASTNodeID;
@@ -447,6 +448,27 @@ public class IdentifierNode extends ExpressionNodeBase implements IIdentifierNod
         if (canEarlyBind(project, def))
             return ((DefinitionBase)def).getMName(project);
 
+        if (def == null)
+        {
+            // no def? see if this is dynamic
+            // or a missing member on a known and non-dynamic def
+            if (getParent().getNodeID() == ASTNodeID.MemberAccessExpressionID)
+            {
+                // ok it is a member expression, are we on the right?
+                MemberAccessExpressionNode mae = (MemberAccessExpressionNode) getParent();
+                if (mae.getRightOperandNode() == this)
+                {
+                    // we're on the right, what is the left?
+                    ITypeDefinition leftDef = mae.getLeftOperandNode().resolveType(project);
+                    if (leftDef != null && leftDef.isDynamic() == false)
+                    {
+                        AccessUndefinedMemberProblem aump = new AccessUndefinedMemberProblem(this,
getName(), leftDef.getQualifiedName());
+                        project.getProblems().add(aump);
+                        return null;
+                    }
+                }
+            }
+        }
         ASScope scope = getASScope();
 
         if (isQualifiedRef())


Mime
View raw message