flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject Re: git commit: [flex-asjs] [refs/heads/feature/browser-event] - goog.Event assumes the getter can be called on the event. Default to the super getter if wrappedEvent is not set (yet).
Date Sun, 23 Jul 2017 08:59:52 GMT
This commit should theoretically work, but it looks like there’s a weird Falcon bug here.

When outputting the getters for target and currentTarget, the “super” reference is being
dropped. I’m assuming it’s because org.apache.flex.events.Event does not actually declare
target and currentTarget. That’s defined in goog.Event. I would think that this should work
though.

org.apache.flex.events.KeyboardEvent.prototype.get__target = function() {
  return this.wrappedEvent ? org.apache.flex.events.getTargetWrapper(this.wrappedEvent.target)
: .target;
};


org.apache.flex.events.KeyboardEvent.prototype.get__currentTarget = function() {
  return this.wrappedEvent ? org.apache.flex.events.getTargetWrapper(this.wrappedEvent.currentTarget)
: .currentTarget;
};

For now, I’m just going to return null if the wrappedEvent is not yet defined...

> On Jul 23, 2017, at 11:36 AM, harbs@apache.org wrote:
> 
> Repository: flex-asjs
> Updated Branches:
>  refs/heads/feature/browser-event f53e941ac -> 3b2a8feb7
> 
> 
> goog.Event assumes the getter can be called on the event. Default to the super getter
if wrappedEvent is not set (yet).
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3b2a8feb
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3b2a8feb
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3b2a8feb
> 
> Branch: refs/heads/feature/browser-event
> Commit: 3b2a8feb763771d6d3e371d89b251068d0cca4fc
> Parents: f53e941
> Author: Harbs <harbs@in-tools.com>
> Authored: Sun Jul 23 11:36:48 2017 +0300
> Committer: Harbs <harbs@in-tools.com>
> Committed: Sun Jul 23 11:36:48 2017 +0300
> 
> ----------------------------------------------------------------------
> .../Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as   | 4 ++--
> .../Core/src/main/flex/org/apache/flex/events/MouseEvent.as      | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b2a8feb/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as
> ----------------------------------------------------------------------
> diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as
> index a05240a..f60110f 100644
> --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as
> +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardEvent.as
> @@ -78,7 +78,7 @@ package org.apache.flex.events
>         COMPILE::JS
> 		public function get target():Object
> 		{
> -			return getTargetWrapper(wrappedEvent.target);
> +			return wrappedEvent ? getTargetWrapper(wrappedEvent.target) : super.target;
> 		}
> 
> 		/**
> @@ -92,7 +92,7 @@ package org.apache.flex.events
>         COMPILE::JS
> 		public function get currentTarget():Object
> 		{
> -			return getTargetWrapper(wrappedEvent.currentTarget);
> +			return wrappedEvent ? getTargetWrapper(wrappedEvent.currentTarget) : super.currentTarget;
> 		}
> 
>         private var _key:String;
> 
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b2a8feb/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 bef5531..1296065 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
> @@ -337,7 +337,7 @@ package org.apache.flex.events
> 		 */
> 		public function get target():Object
> 		{
> -			return getTargetWrapper(wrappedEvent.target);
> +			return wrappedEvent ? getTargetWrapper(wrappedEvent.target) : super.target;
> 		}
> 
> 		/**
> @@ -350,7 +350,7 @@ package org.apache.flex.events
> 		 */
> 		public function get currentTarget():Object
> 		{
> -			return getTargetWrapper(wrappedEvent.currentTarget);
> +			return wrappedEvent ? getTargetWrapper(wrappedEvent.currentTarget) : super.currentTarget;
> 		}
> 
> 		// TODO remove this when figure out how to preserve the real target
> 


Mime
View raw message