flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mschma...@apache.org
Subject [1/2] git commit: [flex-falcon] [refs/heads/develop] - Default param fix.
Date Fri, 26 Jun 2015 11:15:53 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop d77028ae0 -> b32643380


Default param fix.


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

Branch: refs/heads/develop
Commit: 43b9cea67283150fcbc7f01f680693e2ab31cdfb
Parents: d77028a
Author: Michael Schmalle <mschmalle@apache.org>
Authored: Fri Jun 26 07:13:32 2015 -0400
Committer: Michael Schmalle <mschmalle@apache.org>
Committed: Fri Jun 26 07:13:32 2015 -0400

----------------------------------------------------------------------
 .../codegen/externals/utils/FunctionUtils.java     | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/43b9cea6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java
index 6a21cd4..95b27f0 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java
@@ -154,11 +154,26 @@ public class FunctionUtils
 
                 if (parameterType.isOptionalArg())
                 {
-                    sb.append(" = null");
+                    sb.append(" = ");
+                    sb.append(toDefaultParameterValue(paramType));
                 }
             }
         }
 
         return sb.toString();
     }
+
+    private static String toDefaultParameterValue(String paramType)
+    {
+        if (paramType.equals("Function"))
+            return "null";
+        else if (paramType.equals("Number"))
+            return "0";
+        else if (paramType.equals("String"))
+            return "''";
+        else if (paramType.equals("Boolean"))
+            return "false";
+        return "null";
+    }
+
 }


Mime
View raw message