pull/199/head
nightwing 2015-09-16 13:21:58 +04:00
rodzic cc5860594c
commit 0b5343e8c2
1 zmienionych plików z 9 dodań i 8 usunięć

Wyświetl plik

@ -284,10 +284,10 @@ config.baseUrl = "";
require.undef = function(module, recursive) {
if (recursive) {
var root = (module + "/").replace("//", "/");
$undefAll(root, define.errors);
$undefAll(root, define.loaded);
$undefAll(root, define.modules);
var root = (module + "/").replace(/\/+$/, "/");
undefAll(root, define.errors);
undefAll(root, define.loaded);
undefAll(root, define.modules);
}
module = normalizeName("", module);
var path = require.toUrl(module, ".js");
@ -297,10 +297,11 @@ require.undef = function(module, recursive) {
delete define.fetchedUrls[path];
};
function $undefAll(module, hash) {
for (var i in hash)
if (i.lastIndexOf(module, 0) == 0)
require.undef(i);
function undefAll(module, hash) {
Object.keys(hash).forEach(function(key) {
if (key.lastIndexOf(module, 0) == 0)
require.undef(key);
});
}
require.MODULE_LOAD_URL = MODULE_LOAD_URL;