File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
'use strict';
22

3-
// global.api = {};
43
const api = {};
54
api.fs = require('fs');
65
api.vm = require('vm');
76
api.timers = require('timers');
87

9-
// global.application = {};
108
const application = {};
119
application.unit1 = require('./lib/unit1');
1210
application.unit2 = require('./lib/unit2');
1311
require('./lib/unit3')(api, application);
1412

15-
application.reloadUnit = name => {
13+
application.reloadUnit = (name) => {
1614
const moduleKey = require.resolve('./lib/' + name);
1715
delete require.cache[moduleKey];
1816
require('./lib/' + name)(api, application);
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
'use strict';
22

3-
module.exports = (api, metasync) => {
4-
3+
module.exports = (api, application) => {
54
const FILE_SCOPE_CONSTANT = 100;
6-
metasync.MODULE_SCOPE_CONSTANT = 200;
5+
application.APPLICATION_SCOPE_CONSTANT = 200;
76
api.metasync.EXPORTED_CONSTANT = 300;
87

98
const fileScopeFunction = () => {};
10-
metasync.moduleScopeFunction = () => {};
9+
application.applicationScopeFunction = () => {};
1110
api.metasync.exportedFunction = () => {};
1211

12+
console.log({
13+
FILE_SCOPE_CONSTANT,
14+
fileScopeFunction,
15+
});
1316
};
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
module.exports = {
4-
54
showPaths() {
65
console.dir({
76
__dirname,
@@ -13,5 +12,4 @@ module.exports = {
1312
doSomething() {
1413
console.log('Somenting done');
1514
}
16-
1715
};
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const LOCAL_CONSTANT = 'local value';
55
const EXPORTED_CONSTANT = 'exported value';
66

77
module.exports = (api, application) => {
8-
98
application.unit3 = unit3;
109
unit3.EXPORTED_CONSTANT = EXPORTED_CONSTANT;
1110

@@ -20,5 +19,4 @@ module.exports = (api, application) => {
2019

2120
unit3.doSomethingSpecial = () => {
2221
};
23-
2422
};

0 commit comments

Comments
 (0)