flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/2] git commit: [flex-asjs] [refs/heads/develop] - make event constructors match
Date Tue, 01 Mar 2016 01:52:24 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 75ee02d28 -> c313d7066


make event constructors match


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

Branch: refs/heads/develop
Commit: 063ac08e0a5a6c15b06606e5e159ed3154d72648
Parents: 75ee02d
Author: Alex Harui <aharui@apache.org>
Authored: Mon Feb 29 17:51:56 2016 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Feb 29 17:51:56 2016 -0800

----------------------------------------------------------------------
 .../flex/org/apache/flex/events/CustomEvent.as     |  9 +--------
 .../src/main/flex/org/apache/flex/events/Event.as  | 17 +++++++++--------
 .../flex/org/apache/flex/events/EventDispatcher.as | 14 ++++++++++++++
 .../main/flex/org/apache/flex/events/MouseEvent.as |  2 +-
 .../org/apache/flex/events/ValueChangeEvent.as     |  9 +--------
 .../main/flex/org/apache/flex/events/ValueEvent.as | 10 +---------
 6 files changed, 27 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/063ac08e/frameworks/projects/Core/src/main/flex/org/apache/flex/events/CustomEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/CustomEvent.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/CustomEvent.as
index a7921df..ab3e173 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/CustomEvent.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/CustomEvent.as
@@ -51,14 +51,7 @@ package org.apache.flex.events
 		 */
 		public function CustomEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
 		{
-            COMPILE::AS3
-            {
-                super(type, bubbles, cancelable);                    
-            }
-            COMPILE::JS
-            {
-                super(type);
-            }
+            super(type, bubbles, cancelable);                    
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/063ac08e/frameworks/projects/Core/src/main/flex/org/apache/flex/events/Event.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/Event.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/Event.as
index 008909b..8076c66 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/Event.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/Event.as
@@ -105,14 +105,15 @@ package org.apache.flex.events
 
 		public static const CHANGE:String = "change";
 
-        public function Event(type:String, target:Object = null) {
-            super(type, target);
+        public function Event(type:String, bubbles:Boolean = false, cancelable:Boolean =
false) {
+            super(type);
+			this.bubbles = true;
+			this.cancelable = true;
         }
 
-		public function init(type:String):void {
-			this.type = type;
-		}
-		
+		public var bubbles:Boolean;
+		public var cancelable:Boolean;
+				
 		/**
 		 * Google Closure doesn't seem to support stopImmediatePropagation, but
 		 * actually the HTMLElementWrapper fireListener override sends a
@@ -122,12 +123,12 @@ package org.apache.flex.events
 		 */
 		public function stopImmediatePropagation():void
 		{
-			// do nothing
+			throw new Error("stopImmediatePropagation");
 		}
 		
 		public function cloneEvent():org.apache.flex.events.Event
 		{
-			return this;
+			return new org.apache.flex.events.Event(type, bubbles, cancelable);
 		}
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/063ac08e/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
index ceec8ee..f6e635b 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
@@ -62,5 +62,19 @@ package org.apache.flex.events
         {
             return goog.events.hasListener(this, type);
         }
+		
+		override public function dispatchEvent(event:Object):Boolean
+		{
+			try 
+			{
+				return super.dispatchEvent(event);
+			}
+			catch (e:Error)
+			{
+				if (e.name != "stopImmediatePropagation")
+					throw e;
+			}
+			return false;
+		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/063ac08e/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as
index 63bad5c..605885d 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEvent.as
@@ -170,7 +170,7 @@ package org.apache.flex.events
 								   commandKey:Boolean = false, controlKey:Boolean = false,
 								   clickCount:int = 0)
 		{
-			super(type);
+			super(type, bubbles, cancelable);
 
 			this.localX = localX;
 			this.localY = localY;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/063ac08e/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueChangeEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueChangeEvent.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueChangeEvent.as
index 45fabbd..e7c93b0 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueChangeEvent.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueChangeEvent.as
@@ -42,14 +42,7 @@ package org.apache.flex.events
 		public function ValueChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false,

 										 oldValue:Object = null, newValue:Object = null)
 		{
-            COMPILE::AS3
-            {
-    			super(type, bubbles, cancelable);
-            }
-            COMPILE::JS
-            {
-                super(type);
-            }
+    		super(type, bubbles, cancelable);
 			this.oldValue = oldValue;
 			this.newValue = newValue;
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/063ac08e/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueEvent.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueEvent.as
index 6088680..889f079 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueEvent.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/ValueEvent.as
@@ -41,15 +41,7 @@ package org.apache.flex.events
 		public function ValueEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false,

 										 value:Object = null)
 		{
-            COMPILE::AS3
-            {
-    			super(type, bubbles, cancelable);
-            }
-            
-            COMPILE::JS
-            {
-                super(type);
-            }
+			super(type, bubbles, cancelable);
             
 			this.value = value;
 		}


Mime
View raw message