kopia lustrzana https://github.com/c9/core
avoid infinite loop when trying to load a broken module
rodzic
fa9c4881cf
commit
b10daa4413
|
@ -1,8 +1,9 @@
|
||||||
"no use strict";
|
"no use strict";
|
||||||
;(function(window) {
|
;(function(window) {
|
||||||
if (typeof window.window != "undefined" && window.document) {
|
if (typeof window.window != "undefined" && window.document)
|
||||||
|
return;
|
||||||
|
if (window.require && window.define)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
window.console = function() {
|
window.console = function() {
|
||||||
var msgs = Array.prototype.slice.call(arguments, 0);
|
var msgs = Array.prototype.slice.call(arguments, 0);
|
||||||
|
@ -73,6 +74,7 @@ window.require = function(parentId, id) {
|
||||||
var path = chunks.join("/") + ".js";
|
var path = chunks.join("/") + ".js";
|
||||||
|
|
||||||
window.require.id = id;
|
window.require.id = id;
|
||||||
|
window.require.modules[id] = {}; // prevent infinite loop on broken modules
|
||||||
importScripts(path);
|
importScripts(path);
|
||||||
return window.require(parentId, id);
|
return window.require(parentId, id);
|
||||||
};
|
};
|
||||||
|
|
Ładowanie…
Reference in New Issue