You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/11/26 19:14:47 UTC

[06/12] git commit: [flex-asjs] [refs/heads/core_js_to_as] - use 'in' since a missing property won't always throw

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 <ah...@apache.org>
Authored: Wed Nov 25 14:03:02 2015 -0800
Committer: Alex Harui <ah...@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];