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] - report error if binding isn't well-defined
Date Tue, 05 May 2015 20:00:08 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 91463d042 -> 2d716fabf


report error if binding isn't well-defined


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

Branch: refs/heads/develop
Commit: d8a711132368892312af604311d2679c28d541be
Parents: 91463d0
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 5 07:38:53 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue May 5 07:38:53 2015 -0700

----------------------------------------------------------------------
 .../internal/codegen/databinding/WatcherAnalyzer.java        | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d8a71113/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/WatcherAnalyzer.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/WatcherAnalyzer.java
b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/WatcherAnalyzer.java
index c4316c1..666efe6 100644
--- a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/WatcherAnalyzer.java
+++ b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/WatcherAnalyzer.java
@@ -23,6 +23,8 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.flex.compiler.constants.IASKeywordConstants;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
 import org.apache.flex.compiler.definitions.IClassDefinition;
 import org.apache.flex.compiler.definitions.IConstantDefinition;
 import org.apache.flex.compiler.definitions.IDefinition;
@@ -33,6 +35,7 @@ import org.apache.flex.compiler.definitions.IVariableDefinition;
 import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase.WatcherType;
 import org.apache.flex.compiler.internal.projects.FlexProject;
 import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.problems.AccessUndefinedPropertyProblem;
 import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.tree.ASTNodeID;
@@ -265,7 +268,8 @@ public class WatcherAnalyzer
         IDefinition def = node.resolve(project);
         if ((def == null) && !state.isObjectProxyExpression)
         {
-            return;     // this is not "defensive programming"!
+            if (node.getName() == IASKeywordConstants.THIS)
+                return;     // this is not "defensive programming"!
                         // we fully expect to get non-resolvable identifiers in some cases:
                         //      a) bad code. 
                         //      b) "this" 
@@ -275,6 +279,8 @@ public class WatcherAnalyzer
                         // may very well be a dynamic property with no definition,
                         // so will will continue on (with the knowledge that we have no
                         // IDefinition
+            this.problems.add(new AccessUndefinedPropertyProblem(node, node.getName()));
+            return;
         }
         
         if (def instanceof IConstantDefinition)


Mime
View raw message