1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-01-03 18:42:00 +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 + "!"); 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.");
} }
}; };