mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 21:00:23 +01:00
Fix require.register
This commit is contained in:
parent
4e11487d81
commit
7bf1b2e595
@ -38,14 +38,14 @@ const require = function(){
|
||||
throw new ReferenceError("Unable to get non relative module " + module + "!");
|
||||
}
|
||||
|
||||
require.register = function(module, scope = {}){
|
||||
if (!require.exists(module)){
|
||||
const scopeName = getScopeName(module);
|
||||
scope[scopeName] = scope;
|
||||
return scope;
|
||||
require.register = function(moduleName, module = {}){
|
||||
if (!require.exists(moduleName)){
|
||||
const scopeName = getScopeName(moduleName);
|
||||
scope[scopeName] = module;
|
||||
return module;
|
||||
}
|
||||
else {
|
||||
require("./logging").error("Module", module, "already registered.");
|
||||
require("./logging").error("Module", moduleName, "already registered.");
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user