You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2014/11/22 02:01:10 UTC

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

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

This reverts commit ec86ff8db9c5b183318f8ef463e38e727b706cc0.

Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>


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

Branch: refs/heads/iso7skins
Commit: e7e441db77171ee92c620768b385bb832338ee06
Parents: ec86ff8
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Tue Nov 4 08:41:16 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Tue Nov 4 08:41:16 2014 +0100

----------------------------------------------------------------------
 .../framework/src/mx/binding/Binding.as         | 74 ++++++++++----------
 .../framework/src/mx/binding/Watcher.as         | 56 +++++++--------
 .../framework/src/mx/managers/SystemManager.as  | 10 +--
 3 files changed, 68 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/e7e441db/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 b2e0598..6122921 100644
--- a/frameworks/projects/framework/src/mx/binding/Binding.as
+++ b/frameworks/projects/framework/src/mx/binding/Binding.as
@@ -423,46 +423,44 @@ 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)
         {
-            // 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);
-                }
-            }
+			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);
+	                }
+	            }
+			}
         }
 
         return null;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/e7e441db/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 ac35300..fef6ee3 100644
--- a/frameworks/projects/framework/src/mx/binding/Watcher.as
+++ b/frameworks/projects/framework/src/mx/binding/Watcher.as
@@ -199,37 +199,35 @@ 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)
         {
-            // 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;
-            }
+			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;
+	            }
+			}
         }
     }
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/e7e441db/frameworks/projects/framework/src/mx/managers/SystemManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/managers/SystemManager.as b/frameworks/projects/framework/src/mx/managers/SystemManager.as
index 61d41ce..9eb9bea 100644
--- a/frameworks/projects/framework/src/mx/managers/SystemManager.as
+++ b/frameworks/projects/framework/src/mx/managers/SystemManager.as
@@ -1752,7 +1752,7 @@ public class SystemManager extends MovieClip
     {
         // Adjust the partition indexes before the 
         // "added" event is dispatched.
-        noTopMostIndex++;
+        noTopMostIndex = noTopMostIndex + 1;
 
         var oldParent:DisplayObjectContainer = child.parent;
         if (oldParent)
@@ -1790,7 +1790,7 @@ public class SystemManager extends MovieClip
     {
         // Adjust the partition indexes
         // before the "removed" event is dispatched.
-        noTopMostIndex--;
+        noTopMostIndex = noTopMostIndex - 1;
 
         return rawChildren_removeChild(child);
     }
@@ -1802,7 +1802,7 @@ public class SystemManager extends MovieClip
     {
         // Adjust the partition indexes
         // before the "removed" event is dispatched.
-        noTopMostIndex--;
+        noTopMostIndex = noTopMostIndex - 1;
 
         return rawChildren_removeChildAt(applicationIndex + index);
     }
@@ -2658,7 +2658,7 @@ public class SystemManager extends MovieClip
         mouseCatcher.name = "mouseCatcher";
         // Must use addChildAt because a creationComplete handler can create a
         // dialog and insert it at 0.
-        noTopMostIndex++;
+        noTopMostIndex = noTopMostIndex + 1;
         super.addChildAt(mouseCatcher, 0);  
         resizeMouseCatcher();
         if (!topLevel)
@@ -2668,7 +2668,7 @@ public class SystemManager extends MovieClip
         }
 
         // Add the application as child 1.
-        noTopMostIndex++;
+        noTopMostIndex = noTopMostIndex + 1;
         super.addChildAt(DisplayObject(app), 1);
 
         CONFIG::performanceInstrumentation