mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
caa8db93c7
commit
9d5e8b71ed
4 changed files with 152 additions and 114 deletions
|
@ -35,6 +35,21 @@ 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;
|
||||
}
|
||||
else {
|
||||
require("./logging").error("Module", module, "already registered.");
|
||||
}
|
||||
};
|
||||
|
||||
require.exists = function(module){
|
||||
return scope.hasOwnProperty(getScopeName(module));
|
||||
};
|
||||
|
||||
var events = {};
|
||||
require.on = function(module, callback){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue