avoid infinite loop when trying to load a broken module

pull/3/head
nightwing 2015-02-12 03:49:05 +04:00
rodzic fa9c4881cf
commit b10daa4413
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -1,8 +1,9 @@
"no use strict";
;(function(window) {
if (typeof window.window != "undefined" && window.document) {
if (typeof window.window != "undefined" && window.document)
return;
if (window.require && window.define)
return;
}
window.console = function() {
var msgs = Array.prototype.slice.call(arguments, 0);
@ -73,6 +74,7 @@ window.require = function(parentId, id) {
var path = chunks.join("/") + ".js";
window.require.id = id;
window.require.modules[id] = {}; // prevent infinite loop on broken modules
importScripts(path);
return window.require(parentId, id);
};