You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2014/11/03 20:45:15 UTC

[2/2] git commit: [flex-sdk] [refs/heads/develop] - Revert "Minor rewrite to avoid multiple catch blocks in one statement (JS no likey)"

Revert "Minor rewrite to avoid multiple catch blocks in one statement (JS no likey)"

This reverts commit b9d15cf4a2979dbf6786165073317243fa063251.


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

Branch: refs/heads/develop
Commit: ec86ff8db9c5b183318f8ef463e38e727b706cc0
Parents: dc8ead6
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Mon Nov 3 20:41:27 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Mon Nov 3 20:41:27 2014 +0100

----------------------------------------------------------------------
 .../framework/src/mx/binding/Binding.as         | 74 ++++++++++----------
 .../framework/src/mx/binding/Watcher.as         | 56 ++++++++-------
 2 files changed, 67 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ec86ff8d/frameworks/projects/framework/src/mx/binding/Binding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/binding/Binding.as b/frameworks/projects/framework/src/mx/binding/Binding.as
index 6122921..b2e0598 100644
--- a/frameworks/projects/framework/src/mx/binding/Binding.as
+++ b/frameworks/projects/framework/src/mx/binding/Binding.as
@@ -423,44 +423,46 @@ public class Binding
             wrappedFunctionSuccessful = true;
             return result;
         }
+        catch(itemPendingError:ItemPendingError)
+        {
+            itemPendingError.addResponder(new EvalBindingResponder(this, object));
+            if (BindingManager.debugDestinationStrings[destString])
+            {
+                trace("Binding: destString = " + destString + ", error = " + itemPendingError);
+            }
+        }
+        catch(rangeError:RangeError)
+        {
+            if (BindingManager.debugDestinationStrings[destString])
+            {
+                trace("Binding: destString = " + destString + ", error = " + rangeError);
+            }
+        }
         catch(error:Error)
         {
-			if (error is ItemPendingError) {
-	            error.addResponder(new EvalBindingResponder(this, object));
-	            if (BindingManager.debugDestinationStrings[destString])
-	            {
-	                trace("Binding: destString = " + destString + ", error = " + error);
-	            }
-			} else if (error is RangeError) {
-	            if (BindingManager.debugDestinationStrings[destString])
-	            {
-	                trace("Binding: destString = " + destString + ", error = " + error);
-	            }
-			} else {
-	            // Certain errors are normal when executing a srcFunc or destFunc,
-	            // so we swallow them:
-	            //   Error #1006: Call attempted on an object that is not a function.
-	            //   Error #1009: null has no properties.
-	            //   Error #1010: undefined has no properties.
-	            //   Error #1055: - has no properties.
-	            //   Error #1069: Property - not found on - and there is no default value
-	            // We allow any other errors to be thrown.
-	            if ((error.errorID != 1006) &&
-	                (error.errorID != 1009) &&
-	                (error.errorID != 1010) &&
-	                (error.errorID != 1055) &&
-	                (error.errorID != 1069))
-	            {
-	                throw error;
-	            }
-	            else
-	            {
-	                if (BindingManager.debugDestinationStrings[destString])
-	                {
-	                    trace("Binding: destString = " + destString + ", error = " + error);
-	                }
-	            }
-			}
+            // Certain errors are normal when executing a srcFunc or destFunc,
+            // so we swallow them:
+            //   Error #1006: Call attempted on an object that is not a function.
+            //   Error #1009: null has no properties.
+            //   Error #1010: undefined has no properties.
+            //   Error #1055: - has no properties.
+            //   Error #1069: Property - not found on - and there is no default value
+            // We allow any other errors to be thrown.
+            if ((error.errorID != 1006) &&
+                (error.errorID != 1009) &&
+                (error.errorID != 1010) &&
+                (error.errorID != 1055) &&
+                (error.errorID != 1069))
+            {
+                throw error;
+            }
+            else
+            {
+                if (BindingManager.debugDestinationStrings[destString])
+                {
+                    trace("Binding: destString = " + destString + ", error = " + error);
+                }
+            }
         }
 
         return null;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ec86ff8d/frameworks/projects/framework/src/mx/binding/Watcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/binding/Watcher.as b/frameworks/projects/framework/src/mx/binding/Watcher.as
index fef6ee3..ac35300 100644
--- a/frameworks/projects/framework/src/mx/binding/Watcher.as
+++ b/frameworks/projects/framework/src/mx/binding/Watcher.as
@@ -199,35 +199,37 @@ public class Watcher
         {
             wrappedFunction.apply(this);
         }
+        catch(itemPendingError:ItemPendingError)
+        {
+            // The parent's value is not yet available.  This is being ignored for now -
+            // updateParent() will be called when the parent has a value.
+            value = null;
+        }
+        catch(rangeError:RangeError)
+        {
+            // The parent's value is not yet available.  This is being ignored for now -
+            // updateParent() will be called when the parent has a value.
+            value = null;
+        }
         catch(error:Error)
         {
-			if (error is ItemPendingError) {
-	            // The parent's value is not yet available.  This is being ignored for now -
-	            // updateParent() will be called when the parent has a value.
-	            value = null;
-			} else if (error is RangeError) {
-	            // The parent's value is not yet available.  This is being ignored for now -
-	            // updateParent() will be called when the parent has a value.
-	            value = null;
-			} else {
-	            // Certain errors are normal when executing an update, so we swallow them:
-	            //   Error #1006: Call attempted on an object that is not a function.
-	            //   Error #1009: null has no properties.
-	            //   Error #1010: undefined has no properties.
-	            //   Error #1055: - has no properties.
-	            //   Error #1069: Property - not found on - and there is no default value
-	            //   Error #1507: - invalid null argument.
-	            // We allow any other errors to be thrown.
-	            if ((error.errorID != 1006) &&
-	                (error.errorID != 1009) &&
-	                (error.errorID != 1010) &&
-	                (error.errorID != 1055) &&
-	                (error.errorID != 1069) &&
-	                (error.errorID != 1507))
-	            {
-	                throw error;
-	            }
-			}
+            // Certain errors are normal when executing an update, so we swallow them:
+            //   Error #1006: Call attempted on an object that is not a function.
+            //   Error #1009: null has no properties.
+            //   Error #1010: undefined has no properties.
+            //   Error #1055: - has no properties.
+            //   Error #1069: Property - not found on - and there is no default value
+            //   Error #1507: - invalid null argument.
+            // We allow any other errors to be thrown.
+            if ((error.errorID != 1006) &&
+                (error.errorID != 1009) &&
+                (error.errorID != 1010) &&
+                (error.errorID != 1055) &&
+                (error.errorID != 1069) &&
+                (error.errorID != 1507))
+            {
+                throw error;
+            }
         }
     }