flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [06/12] git commit: [flex-asjs] [refs/heads/core_js_to_as] - use 'in' since a missing property won't always throw
Date Thu, 26 Nov 2015 18:14:47 GMT
use 'in' since a missing property won't always throw


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

Branch: refs/heads/core_js_to_as
Commit: 755ed103ec7efe5110e353642502f1734666d04f
Parents: 8177f91
Author: Alex Harui <aharui@apache.org>
Authored: Wed Nov 25 14:03:02 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Wed Nov 25 14:03:02 2015 -0800

----------------------------------------------------------------------
 .../src/org/apache/flex/binding/ConstantBinding.as   | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/755ed103/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as
b/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as
index 0bc7a55..0a2ae83 100644
--- a/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as
+++ b/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as
@@ -134,12 +134,17 @@ package org.apache.flex.binding
             else
                 source = document;
             var val:*;
-            try 
+            if (sourcePropertyName in source)
             {
-                val = source[sourcePropertyName];
-                destination[destinationPropertyName] = val;
-            } 
-            catch (e:Error)
+                try {
+                    val = source[sourcePropertyName];
+                    destination[destinationPropertyName] = val;
+                }
+                catch (e:Error)
+                {
+                }
+            }
+            else if (sourcePropertyName in source.constructor)
             {
                 try {
                     val = source.constructor[sourcePropertyName];


Mime
View raw message