1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 21:00:23 +01:00

Fix require.register

This commit is contained in:
kkapsner 2019-02-26 15:59:44 +01:00
parent 4e11487d81
commit 7bf1b2e595

View File

@ -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.");
}
};