do not create infinite loop if module has circular dependencies + cleanup
This commit is contained in:
parent
94ea9a5845
commit
a69a9f12d4
1 changed files with 1 additions and 4 deletions
|
|
@ -35,8 +35,8 @@ var require = function(parentId, id) {
|
||||||
var module = require.modules[id];
|
var module = require.modules[id];
|
||||||
if (module) {
|
if (module) {
|
||||||
if (!module.initialized) {
|
if (!module.initialized) {
|
||||||
module.exports = module.factory().exports;
|
|
||||||
module.initialized = true;
|
module.initialized = true;
|
||||||
|
module.exports = module.factory().exports;
|
||||||
}
|
}
|
||||||
return module.exports;
|
return module.exports;
|
||||||
}
|
}
|
||||||
|
|
@ -139,7 +139,4 @@ onmessage = function(e) {
|
||||||
else if (msg.event && sender) {
|
else if (msg.event && sender) {
|
||||||
sender._emit(msg.event, msg.data);
|
sender._emit(msg.event, msg.data);
|
||||||
}
|
}
|
||||||
if (msg.eval) {
|
|
||||||
console.log(eval(msg.eval));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue