mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Cleanup require system
This commit is contained in:
parent
11b8ddfcc8
commit
574efa23e7
35 changed files with 45 additions and 67 deletions
|
@ -39,13 +39,14 @@ const require = function(){
|
|||
}
|
||||
|
||||
require.register = function(moduleName, module = {}){
|
||||
const scopeName = getScopeName(moduleName);
|
||||
if (!require.exists(moduleName)){
|
||||
const scopeName = getScopeName(moduleName);
|
||||
scope[scopeName] = module;
|
||||
return module;
|
||||
}
|
||||
else {
|
||||
require("./logging").error("Module", moduleName, "already registered.");
|
||||
return scope[scopeName];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue