flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [3/5] git commit: [flex-falcon] [refs/heads/develop] - handle missing types so we can get to the reducer where it will report those missing types
Date Wed, 01 Oct 2014 22:36:55 GMT
handle missing types so we can get to the reducer where it will report those missing types


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

Branch: refs/heads/develop
Commit: 958a547576385fc621417cf3de265dc59571f152
Parents: 73fe2bc
Author: Alex Harui <aharui@apache.org>
Authored: Tue Sep 30 10:46:37 2014 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Sep 30 10:46:37 2014 -0700

----------------------------------------------------------------------
 .../internal/as/codegen/ClassDirectiveProcessor.java | 15 +++++++++++++--
 .../databinding/MXMLBindingDirectiveHelper.java      |  4 ++++
 .../compiler/internal/tree/mxml/MXMLTreeBuilder.java |  4 ++--
 3 files changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/958a5475/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
index 9af1d45..60cf7d6 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
@@ -809,16 +809,27 @@ class ClassDirectiveProcessor extends DirectiveProcessor
                 funcDef.setOverride();
             if (funcDef instanceof GetterDefinition)
             {
+                Name funcTypeName;
+                TypeDefinitionBase typeDef = funcDef.resolveType(project);
+                if ( SemanticUtils.isType(typeDef) )
+                    funcTypeName = typeDef.getMName(project);
+                else
+                    funcTypeName = NAME_OBJECT;
                 DefinitionBase bindableGetter = func.buildBindableGetter(funcName.getBaseName());
                 ASScope funcScope = (ASScope)funcDef.getContainingScope();
                 bindableGetter.setContainingScope(funcScope);
                 LexicalScope ls = funcDef.isStatic()? classStaticScope: classScope;
                 ls.generateBindableGetter(bindableGetter, funcName, bindableName, 
-                                        funcDef.resolveType(project).getMName(project), getAllMetaTags(funcDef));
+                                        funcTypeName, getAllMetaTags(funcDef));
             }
             else
             {
+                Name funcTypeName;
                 TypeDefinitionBase typeDef = funcDef.resolveType(project);
+                if ( SemanticUtils.isType(typeDef) )
+                    funcTypeName = typeDef.getMName(project);
+                else
+                    funcTypeName = NAME_OBJECT;
                 ASScope funcScope = (ASScope)funcDef.getContainingScope();
                 DefinitionBase bindableSetter = func.buildBindableSetter(funcName.getBaseName(),

                         funcScope,
@@ -826,7 +837,7 @@ class ClassDirectiveProcessor extends DirectiveProcessor
                 bindableSetter.setContainingScope(funcScope);
                 LexicalScope ls = funcDef.isStatic()? classStaticScope: classScope;
                 ls.generateBindableSetter(bindableSetter, funcName, bindableName, 
-                        typeDef.getMName(project), getAllMetaTags(funcDef));  
+                        funcTypeName, getAllMetaTags(funcDef));
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/958a5475/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
index 105c7a0..9366f25 100644
--- a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
+++ b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/MXMLBindingDirectiveHelper.java
@@ -228,6 +228,10 @@ public class MXMLBindingDirectiveHelper
                 ret.addInstruction(OP_pushnull);
             
             s = bi.getDestinationString();
+            // in badly broken code, you can bind to a non-existing type
+            // and end up with null here
+            if (s == null)
+                s = "";
             if (s.contains("."))
             {
                 String[] parts = s.split("\\.");

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/958a5475/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLTreeBuilder.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLTreeBuilder.java
b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLTreeBuilder.java
index 5165ff9..c343744 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLTreeBuilder.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLTreeBuilder.java
@@ -563,7 +563,7 @@ public class MXMLTreeBuilder
             }
         }
 
-        String typeName = type.getQualifiedName();
+        String typeName = (type != null) ? type.getQualifiedName() : "";
 
         if (expressionNode == null)
         {
@@ -640,7 +640,7 @@ public class MXMLTreeBuilder
         // can change which property definition it refers to.
         percentProxyDefinition = null;
 
-        String typeName = type.getQualifiedName();
+        String typeName = (type != null) ? type.getQualifiedName() : "";
 
         // For a property of type IFactory, create an MXMLFactoryNode.
         if (typeName.equals(project.getFactoryInterface()))


Mime
View raw message