This still does not address the issue where a class is relying on another class in a static variable.
MyClassA.myB:MyClassB = MyClassB.getInstance(); If MyClassA is loaded before MyClassB, this code will fail. If however, both classes are first loaded and only then, the initializers are called (for constants and variables), the above code would be fine. On Jul 18, 2016, at 9:10 AM, Alex Harui <aha...@adobe.com> wrote: > > > On 7/17/16, 11:02 PM, "Harbs" <harbs.li...@gmail.com> wrote: > >> Well, I guess the question is where the init functions would be called. >> >> My idea was that the “instance init function call would be added to the >> constructor as the first thing that happens (with the exception of >> calling init on the super-class first). > > Right now, instance initialization happens in the constructor. I can't > immediately think of a a scenario where that isn't sufficient. > >> >> The class initializers is more of a question. I figured that might need >> to be added into whatever code loads the js files. > > I think I would end each .js file with: > > SomeClass.cinit = function() > { > // all class initializer code > } > SomeClass.cinit(); > > > Maybe I'm not thinking of some scenario where more is needed. > > -Alex >