You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2022/03/09 01:34:45 UTC

[royale-asjs] branch develop updated (e0579da -> 88c72e1)

This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


    from e0579da  [maven-release-plugin] prepare for next development iteration
     new 9c8847b  Fix cloning in mx TreeEvent
     new 88c72e1  Fix in EventDispatcher : re-dispatching an Event should automatically clone the original Event, because target (after it is initially set the first time) is immutable.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../royale/org/apache/royale/events/EventDispatcher.as    |  5 +++++
 .../MXRoyale/src/main/royale/mx/events/TreeEvent.as       | 15 ++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

[royale-asjs] 02/02: Fix in EventDispatcher : re-dispatching an Event should automatically clone the original Event, because target (after it is initially set the first time) is immutable.

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 88c72e1785067c8a4da2035d772466333dc55006
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Mar 9 14:31:14 2022 +1300

    Fix in EventDispatcher : re-dispatching an Event should automatically clone the original Event, because target (after it is initially set the first time) is immutable.
---
 .../Core/src/main/royale/org/apache/royale/events/EventDispatcher.as | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/EventDispatcher.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/EventDispatcher.as
index 30dbd67..d3b9bca 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/EventDispatcher.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/EventDispatcher.as
@@ -85,6 +85,11 @@ package org.apache.royale.events
 					//console.log("created event from string ",event);
 				}
 				else if ("target" in event1) {
+					if (event1.target && 'cloneEvent' in event1) {
+						//we are re-dispatching, we need to clone the original:
+						event1 = event1.cloneEvent();
+					}
+
 					event1.target = _dispatcher;
 					//console.log("assigned target to event ",event);
 				}

[royale-asjs] 01/02: Fix cloning in mx TreeEvent

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 9c8847b32f82b387504f658eb0cb338df01d3848
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Mar 9 14:18:43 2022 +1300

    Fix cloning in mx TreeEvent
---
 .../MXRoyale/src/main/royale/mx/events/TreeEvent.as       | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/events/TreeEvent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/events/TreeEvent.as
index 514e900..4940ff7 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/events/TreeEvent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/events/TreeEvent.as
@@ -23,8 +23,10 @@ package mx.events
 		
 	import org.apache.royale.events.Event;
 	import mx.controls.listClasses.IListItemRenderer;
-	
-	/**
+
+	import org.apache.royale.events.IRoyaleEvent;
+
+/**
 	 *  The TreeEvent class represents the event object passed to the event
 	 *  listener for events that are associated with activities
 	 *  in tree, such as when a tree branch opens or closes.
@@ -313,21 +315,20 @@ package mx.events
 		 *  @productversion Flex 3
 		 */
 		public var triggerEvent:Event;
-		
+
 		//--------------------------------------------------------------------------
 		//
 		//  Overridden methods: Event
 		//
 		//--------------------------------------------------------------------------
-		
+
 		/**
 		 *  @private
 		 */
-		COMPILE::SWF
-		override public function clone():Event
+		override public function cloneEvent():IRoyaleEvent
 		{
 			return new TreeEvent(type, bubbles, cancelable,
-				item, itemRenderer, triggerEvent);
+					item, itemRenderer, triggerEvent);
 		}
 	}