use non-zero injection point for 'start of script array'. clean up module loading a bit
This commit is contained in:
parent
85a58f8f50
commit
5a82a7c746
4 changed files with 29 additions and 19 deletions
|
|
@ -5,11 +5,21 @@
|
|||
(function () {
|
||||
|
||||
if (!self.kiri) {
|
||||
let modfns = self.kirimod = [];
|
||||
|
||||
let kiri = self.kiri = {
|
||||
beta: 3301,
|
||||
driver: {}, // driver modules
|
||||
loader: [], // module loading: array of functions
|
||||
load: (fn) => kiri.loader.push(fn)
|
||||
loader: modfns, // module loading: array of functions
|
||||
load(fn) {
|
||||
kiri.loader.push(fn);
|
||||
},
|
||||
load_exec() {
|
||||
// complete module loading
|
||||
modfns.forEach(modfn => { modfn(kiri.api)} );
|
||||
// rewrite load() to be immediate post-finalize
|
||||
kiri.load = (modfn) => { modfn(kiri.api) };
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue