To be clear: I’m currently struggling with goog.inherits(MySubClass, MySuperClass); For some reason (which I’m not totally clear on) MySubClass is being loaded first, and MySuperClass is not yet defined when this code is called.
If goog.inherits was mored to an initializer which is lazy-evaluated, I believe this error would go away. On Jul 18, 2016, at 9:25 AM, Harbs <harbs.li...@gmail.com> wrote: > I’m also not sure how the prototype is being setup. > > It could be you’ve already solved my concerns there, but it looks like a lot > of the prototype is being setup outside the constructor. > > 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 >> >