kopia lustrzana https://github.com/c9/core
fix require.undef for resources loaded via `text!`
rodzic
ba37d7a164
commit
8f36832df0
|
@ -299,8 +299,17 @@ require.undef = function(module, recursive) {
|
||||||
|
|
||||||
function undefAll(module, hash) {
|
function undefAll(module, hash) {
|
||||||
Object.keys(hash).forEach(function(key) {
|
Object.keys(hash).forEach(function(key) {
|
||||||
|
var i = key.indexOf("!") + 1;
|
||||||
if (key.lastIndexOf(module, 0) == 0)
|
if (key.lastIndexOf(module, 0) == 0)
|
||||||
require.undef(key);
|
require.undef(key);
|
||||||
|
if (i) {
|
||||||
|
var plugin = key.slice(0, i - 1);
|
||||||
|
var resource = key.slice(i);
|
||||||
|
if (resource.lastIndexOf(module, 0) == 0 || plugin.lastIndexOf(module, 0) == 0) {
|
||||||
|
require.undef(key);
|
||||||
|
require.undef(resource);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue