-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd.js
42 lines (37 loc) · 906 Bytes
/
add.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const common = require('./common');
const log = false;
module.exports = {
object : function(key,object){
common.tell('adding global function',log);
if(!key){
return common.error('not_found-key');
}
if(!object){
return common.error('not_found-object');
}
engine['global']['object'][key] = object;
return true;
},
function : function(key,func){
common.tell('adding global function',log);
if(!key){
return common.error('not_found-key');
}
if(!func){
return common.error('not_found-func');
}
engine['global']['function'][key] = func;
return true;
},
comp : function(key,mod){
common.tell('adding global comp',log);
if(!key){
return common.error('not_found-key');
}
if(!mod){
return common.error('not_found-module');
}
engine['global']['comp'][key] = mod;
return true;
}
};