On 3/28/17, 12:59 AM, "Greg Dove" <gregd...@apache.org> wrote:
>Hi Alex, if you have time, perhaps you can shed some light on this? > >I have an mxml component using states, that implements an Interface, >IFormSequence. > >the generated CLASS_INFO looks like this: >FLEXJS_CLASS_INFO = { names: [{ name: 'ActionForm', qName: >'components.forms.ActionForm', kind: 'class' }], interfaces: >[components.forms.IFormSequence] }; > >and the goog.require for the interface is there at the top >goog.require('components.forms.IFormSequence'); > >I notice that the >goog.addDependency('../../../components/forms/IFormSequence.js', >['components.forms.IFormSequence'], []); > >appears after the >goog.addDependency('../../../components/forms/ActionForm.js', >['components.forms.ActionForm'], ['org.apache.flex.html.Group']); >in the index.html. >Perhaps the order here is not important and goog resolves everything >somehow, but I did wonder if the dependency chain in for ActionForm.js >above should also contain the interface (that's a question, not a >suggestion - I don't know what is right here). At the moment there is an >issue where there is an interface check on startup when states or styles >or something like this are being initialized (it is actually a check for >a different interface, but because the 'interfaces' array is defined and >has length in CLASS_INFO it looks there and tries to follow follow the >inheritance chain on the undefined Interface reference, causing mayhem). >Because the reference inside the CLASS_INFO evaluates to undefined, I >know the dependencies are not loading in the right order. AFAIK, the order of addDependency not important. The addDependency calls appear to build a lookup table that doesn't get used until evaluating the first goog.require. Without -remove-circulars, any class or interface reference that is actually used in the output should have a goog.require for it. In the compiler, the usedNames list keeps track of which classes and interfaces are in the output. Type references do not always end up in the output. For example, if the only reference in AS is "var foo:IMyInterface" then IMyInterface doesn't go in the output because we don't generate type-checking code. Starting last week, With -remove-circulars, only references via extends, implements, and static initializers go in the dependency list and retain goog.requires in the output. But in this case, the interface should still be in the list. Anyway, the list of dependencies was broken until about two commits ago. So try again and see if it works. And not handling native JS types in static initializers was causing the exception in GetListOFFiles until my most recent commit. So pull down everything and see if the interface appears in the addDependency list again (without remove-circulars). HTH, -Alex