blob: cdd7a0e2929628fdba7264bdaef18221d9e23149 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
'use strict';
// ensure the order which manifest scripts and dynamically registered scripts
// are executed in doesn't matter for initialization, by using a stub.
if (!this.ns) {
let deferredSetup = null;
let nsStub = this.ns = {
config: {},
setup(DEFAULT, MARKER) {
deferredSetup = [DEFAULT, MARKER];
},
merge: ns => {
ns.config = Object.assign(ns.config, nsStub.config);
this.ns = ns;
if (deferredSetup) {
ns.setup(...deferredSetup);
}
}
}
}
|