libObjectInitializerobject | misc.t[2440] |
Superclass Tree | Property Summary | Method Summary | Property Details | Method Details |
During startup, we'll automatically call the classInit() method for each class object, and we'll call the default constructor for each static object instance. ("Static" objects are those defined directly in the source code, as opposed to objects created dynamically with 'new'.) This makes it easier to write initialization code by making the process more uniform across static and dynamic objects.
The first step is to call classInit() on each class. We call this method only each class that *directly* defines the method (i.e., we don't call it on classes that only inherit the method from another class). We cycle through the objects in arbitrary order. However, you can control the relative order when there's a dependency by setting the 'classInitFirst' property to a list of one or more classes to initialize first. When we encounter a class with this property, we'll call the listed classes' classInit() methods before calling the given class's classInit().
The second step is to call constructStatic() or construct() on each regular (non-class) object. We only call this on *static* objects: objects defined directly in the source code, as opposed to created dynamically with 'new'. As with classInit(), we visit the objects in arbitrary order. You can control dependencies using the 'constructFirst' method: set this to a list of objects to be initialized before self.
If an object defines or inherits a constructStatic() method, we'll call it instead of construct(). Otherwise, if it defines or inherits a construct() method with no arguments, we'll call it. Otherwise we'll do nothing.
Note that it's possible for a base class to have a compatible zero-argument constructor, but for a subclass to override this with a constructor that takes arguments. In this case, we'll search the class tree for an inherited zero-argument constructor. If we find one, we'll call the inherited constructor.
We can only call zero-argument construct() methods because we have no basis for providing other arguments.
libObjectInitializer : PreinitObject
libObjectInitializer
PreinitObject
ModuleExecObject
object
Inherited from PreinitObject
:
reverseGlobalSymbols
Inherited from ModuleExecObject
:
execAfterMe
hasInitialized_
isDoingExec_
isExecuted_
Inherited from ModuleExecObject
:
_execute
classExec
_initedTab | misc.t[2567] |
execBeforeMe OVERRIDDEN | misc.t[2441] |
callConstructor (obj, conProp, preProp) | misc.t[2513] |
execute ( ) OVERRIDDEN | misc.t[2442] |