flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [7/7] git commit: [flex-falcon] [refs/heads/develop] - Cleaned up special case code for toString()
Date Wed, 06 Jan 2016 07:37:05 GMT
Cleaned up special case code for toString()

Fixes missing toString() in generated Date.as and others


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

Branch: refs/heads/develop
Commit: d1b4ed22d296994c8560219148b8a76124ec1ce0
Parents: d259345
Author: Andy Dufilie <andrew.dufilie@iweave.com>
Authored: Tue Jan 5 10:06:55 2016 -0500
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Jan 5 23:33:57 2016 -0800

----------------------------------------------------------------------
 .../codegen/externals/reference/ClassReference.java     | 12 ++++++++++--
 .../codegen/externals/reference/MethodReference.java    |  8 +++-----
 2 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d1b4ed22/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
index 59c5859..405aaa0 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
@@ -572,9 +572,17 @@ public class ClassReference extends BaseReference
         MethodReference method = new MethodReference(getModel(), this, node, functionName,
comment, isStatic);
 
         if (isStatic)
-        	staticMethods.put(functionName, method);
+        {
+            staticMethods.put(functionName, method);
+        }
+        else if (getQualifiedName().equals("Object") && functionName.equals("toString"))
+        {
+            // skipping Object.prototype.toString() allows toString(opt_radix) for Number,
int and uint
+        }
         else
-        	instanceMethods.put(functionName, method);
+        {
+       	    instanceMethods.put(functionName, method);
+        }
         return method;
     }
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d1b4ed22/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java
index 10fb053..96aa9f2 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java
@@ -140,10 +140,8 @@ public class MethodReference extends MemberReference
         }
 
         String qName = getQualifiedName();
-        // allow overrides of toString for Number, int and uint
-        if (!qName.equals("toString") && getClassReference().hasSuperMethod(qName))
-            return;
-        else if (qName.equals("toString") && className.equals("Object"))
+        // skip overrides since they have to have the same signature as the super method
+        if (getClassReference().hasSuperMethod(qName))
         	return;
 
         emitComment(sb);
@@ -197,7 +195,7 @@ public class MethodReference extends MemberReference
             braces = " { " + returns + " }";
         }
         
-        if (!qName.equals("toString") && getClassReference().hasSuperMethod(qName))
+        if (getClassReference().hasSuperMethod(qName))
         {
         	isOverride = "override ";
         }


Mime
View raw message