flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [09/25] git commit: [flex-asjs] [refs/heads/refactor-sprite] - [BUGFIX] [PLEASE REVIEW] This seems necessary for IEventDispatcher implementations (not extending EventDispatcher). Otherwise TypeError occurs. Not ideal...
Date Tue, 06 Sep 2016 06:17:57 GMT
[BUGFIX] [PLEASE REVIEW] This seems necessary for IEventDispatcher implementations (not extending
EventDispatcher). Otherwise TypeError occurs. Not ideal...


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

Branch: refs/heads/refactor-sprite
Commit: 2c21ebc419cd4e911c74f6247229ca6b375b46a9
Parents: 275e13e
Author: greg-dove <greg.dove@gmail.com>
Authored: Sat Aug 27 15:57:48 2016 +1200
Committer: greg-dove <greg.dove@gmail.com>
Committed: Sat Aug 27 15:57:48 2016 +1200

----------------------------------------------------------------------
 .../flex/org/apache/flex/events/EventDispatcher.as  | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2c21ebc4/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 7f1b134..d4bc1a9 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
@@ -61,8 +61,20 @@ package org.apache.flex.events
 	{
         public function EventDispatcher(target:IEventDispatcher = null)
         {
-            if (target != null)
-                setTargetForTesting(target);
+            if (target != null) {
+				setTargetForTesting(target);
+				//the following can be required with IEventDispatcher implementation instead of extending
EventDispatcher
+				//(fireListeners is not required by IEventDispatcher, but is called on the 'currentTarget'
+				//by the ancestor goog.events.EventTarget code)
+				var obj:Object = target;
+				if (!obj.fireListeners) {
+					var me:EventDispatcher = this;
+					obj.fireListeners = function ():* {
+						me.fireListeners.apply(me,arguments);
+					};
+				}
+			}
+                
         }
         
         public function hasEventListener(type:String):Boolean


Mime
View raw message