Good thought, but it does not work. With the modified typedef, I get this which generates an RTE because “get__target” is not defined:
return this.wrappedEvent ? org.apache.flex.events.getTargetWrapper(this.wrappedEvent.target) : org.apache.flex.events.MouseEvent.superClass_.get__target.apply(this); > On Jul 23, 2017, at 12:25 PM, Alex Harui <aha...@adobe.com.INVALID> wrote: > > It may not be a getter in goog.Event and just a var instead. It might be > ok to modify the typedefs to make it a getter. > > HTH, > -Alex > > On 7/23/17, 1:59 AM, "Harbs" <harbs.li...@gmail.com > <mailto:harbs.li...@gmail.com>> wrote: > >> 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, ha...@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: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u> >>> s.apache.org >>> <http://s.apache.org/>%2Frepos%2Fasf%2Fflex-asjs%2Frepo&data=02%7C01%7C%7C6220b295f >>> 3164be8c9b608d4d1a93840%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6363 >>> 63972100230488&sdata=NnjD1v1Q0qgXCroxbCqrYJ7jZQYEIgoEF3r%2B3PgY9eE%3D&res >>> erved=0 >>> Commit: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u> >>> s.apache.org >>> <http://s.apache.org/>%2Frepos%2Fasf%2Fflex-asjs%2Fcommit%2F3b2a8feb&data=02%7C01%7 >>> C%7C6220b295f3164be8c9b608d4d1a93840%7Cfa7b1b5a7b34438794aed2c178decee1%7 >>> C0%7C0%7C636363972100230488&sdata=dW4KyFwidrnA41bUXzqrleDUlciVmVfL1e34Wl6 >>> %2F8SM%3D&reserved=0 >>> Tree: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u> >>> s.apache.org >>> <http://s.apache.org/>%2Frepos%2Fasf%2Fflex-asjs%2Ftree%2F3b2a8feb&data=02%7C01%7C% >>> 7C6220b295f3164be8c9b608d4d1a93840%7Cfa7b1b5a7b34438794aed2c178decee1%7C0 >>> %7C0%7C636363972100230488&sdata=kvueX%2B4MeHMF1PVOHWvF0MP3zPpGLfjeCgBuG0W >>> Im%2FI%3D&reserved=0 >>> Diff: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u> >>> s.apache.org >>> <http://s.apache.org/>%2Frepos%2Fasf%2Fflex-asjs%2Fdiff%2F3b2a8feb&data=02%7C01%7C% >>> 7C6220b295f3164be8c9b608d4d1a93840%7Cfa7b1b5a7b34438794aed2c178decee1%7C0 >>> %7C0%7C636363972100230488&sdata=cKc96Cx35C1MupN66KbdtYJ6eRpcGOfatDqoAPEHi >>> d0%3D&reserved=0 >>> >>> Branch: refs/heads/feature/browser-event >>> Commit: 3b2a8feb763771d6d3e371d89b251068d0cca4fc >>> Parents: f53e941 >>> Author: Harbs <ha...@in-tools.com <mailto:ha...@in-tools.com>> >>> Authored: Sun Jul 23 11:36:48 2017 +0300 >>> Committer: Harbs <ha...@in-tools.com <mailto:ha...@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(-) >>> ---------------------------------------------------------------------- >>> >>> >>> >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u> >>> s.apache.org >>> <http://s.apache.org/>%2Frepos%2Fasf%2Fflex-asjs%2Fblob%2F3b2a8feb%2Fframeworks%2Fp >>> rojects%2FCore%2Fsrc%2Fmain%2Fflex%2Forg%2Fapache%2Fflex%2Fevents%2FKeybo >>> ardEvent.as&data=02%7C01%7C%7C6220b295f3164be8c9b608d4d1a93840%7Cfa7b1b5a >>> 7b34438794aed2c178decee1%7C0%7C0%7C636363972100230488&sdata=EMmm0ImlYAdzd >>> myVcQF%2BWeJffDHBIryk%2FFrqTs8M4I0%3D&reserved=0 >>> ---------------------------------------------------------------------- >>> diff --git >>> a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardE >>> vent.as >>> b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardE >>> vent.as >>> index a05240a..f60110f 100644 >>> --- >>> a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardE >>> vent.as >>> +++ >>> b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/KeyboardE >>> vent.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; >>> >>> >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u> >>> s.apache.org >>> <http://s.apache.org/>%2Frepos%2Fasf%2Fflex-asjs%2Fblob%2F3b2a8feb%2Fframeworks%2Fp >>> rojects%2FCore%2Fsrc%2Fmain%2Fflex%2Forg%2Fapache%2Fflex%2Fevents%2FMouse >>> Event.as&data=02%7C01%7C%7C6220b295f3164be8c9b608d4d1a93840%7Cfa7b1b5a7b3 >>> 4438794aed2c178decee1%7C0%7C0%7C636363972100230488&sdata=3sKtLMHsbJTdREgC >>> BkoPfKI0UMVGS9rc7%2BZMrQrZy%2Bs%3D&reserved=0 >>> ---------------------------------------------------------------------- >>> diff --git >>> a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEven >>> t.as >>> b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEven >>> t.as >>> index bef5531..1296065 100644 >>> --- >>> a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEven >>> t.as >>> +++ >>> b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/MouseEven >>> t.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