On 8/19/15, 2:17 PM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> > > >Hi, > >Actually, I was trying to translate event.js and seen: > >// EventHandler and ErrorHandler are not listed as deps for >// some of the event classes because they would cause >// circularities so we force them in here. > >goog.require('goog.debug.ErrorHandler'); >goog.require('goog.events.EventHandler'); > >I didn't get why this classes should be forced though ? You can try doing it as ‘expected’. That could be old code, but GCL is picky about circular dependencies. > >I started to create an extern for GCL, at least the parts needed, it was >partly generated, partly hand coded and I haven't been able to compile it >with Ant, I created a project in IJ instead at the moment and just >started to use the GCL.swc now. > >For the rest of the class, the type var is in the super class, I didn't >get why it has been added to the class, any idea ? Maybe to @export it? >I don't see any reason either why CHANGE should be in >org.apache.flex.events.Event.EventType, any idea ? Probably because it is a commonly used event name. It doesn’t have to be that way. > >/** > * Enum type for the events fired by the FlexJS Event > * @enum {string} > */ >org.apache.flex.events.Event.EventType = { > CHANGE: 'change' > }; > > >/** > * @export > * @type {string} type The event type. > */ >org.apache.flex.events.Event.prototype.type = ''; > > >/** > * @export > * @param {string} type The event type. > */ >org.apache.flex.events.Event.prototype.init = function(type) { > this.type = type; >}; > >So, I simply translated it like that: > > COMPILE::JS > public class Event extends goog.events.Event { > > public static const CHANGE:String = "change"; > > public function Event(type:String, target:Object = null) { > super(type, target); > } > > public function init(type:String):void { > this.type = type; > } > } > >Does it seem ok ? I think so. > >It takes time because I'm reviewing in the same time and my time is >limited. Thanks for working on it. Every little bit helps. -Alex