flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - allow both a class in the 'goog' package called 'events' and classes in the 'goog.events' package. Before this change, goog.events.fireListener didn't resolve because it always assumed that 'goog.events'
Date Thu, 17 Sep 2015 06:24:20 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 6be387f1e -> 0cbb5ae00


allow both a class in the 'goog' package called 'events' and classes in the 'goog.events'
package.  Before this change, goog.events.fireListener didn't resolve because it always assumed
that 'goog.events' was a package.  Now it will also try to see if goog.events is a class with
a fireListener method on it.


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

Branch: refs/heads/develop
Commit: 0cbb5ae00cc39b92b8f12f9c50c17bb39f01814f
Parents: 6be387f
Author: Alex Harui <aharui@apache.org>
Authored: Wed Sep 16 23:25:00 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Wed Sep 16 23:25:00 2015 -0700

----------------------------------------------------------------------
 .../flex/compiler/internal/tree/as/IdentifierNode.java  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/0cbb5ae0/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 42f379b..f1d9e46 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
@@ -348,6 +348,7 @@ public class IdentifierNode extends ExpressionNodeBase implements IIdentifierNod
         }
 
         boolean isMemberRef = isMemberRef();
+        boolean wasMemberRef = isMemberRef;
 
         if (isMemberRef && baseIsPackage())
         {
@@ -380,8 +381,17 @@ public class IdentifierNode extends ExpressionNodeBase implements IIdentifierNod
         {
             if (qualifier == null)
                 result = asScope.findProperty(project, name, getDependencyType(), isTypeRef());
-            else
+            else {
                 result = asScope.findPropertyQualified(project, qualifier, name, getDependencyType(),
isTypeRef());
+                if (result == null && wasMemberRef && baseIsPackage())
+                {
+                    // if we get here it was because there is a memberaccessexpression like
"a.b.foo"
+                    // that did not resolve because a.b is a package but foo isn't a class.
 There is a chance that
+                    // "a" by itself is a package and there is a class "b" with a member
called "foo" so
+                    // look for that
+                    result = resolveMemberRef(project, asScope, name, null);
+                }
+            }
         }
 
         return result;


Mime
View raw message