mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 18:42:00 +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 + "!");
|
throw new ReferenceError("Unable to get non relative module " + module + "!");
|
||||||
}
|
}
|
||||||
|
|
||||||
require.register = function(module, scope = {}){
|
require.register = function(moduleName, module = {}){
|
||||||
if (!require.exists(module)){
|
if (!require.exists(moduleName)){
|
||||||
const scopeName = getScopeName(module);
|
const scopeName = getScopeName(moduleName);
|
||||||
scope[scopeName] = scope;
|
scope[scopeName] = module;
|
||||||
return scope;
|
return module;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
require("./logging").error("Module", module, "already registered.");
|
require("./logging").error("Module", moduleName, "already registered.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user