give name to PatchedFactory
This commit is contained in:
parent
c9c09b95a3
commit
acbc932542
|
@ -327,8 +327,9 @@ function patchFactory(id: PropertyKey, factory: ModuleFactory) {
|
||||||
if (!patch.all) patches.splice(i--, 1);
|
if (!patch.all) patches.splice(i--, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The patched factory wrapper
|
// The patched factory wrapper, define it in an object to preserve the name after minification
|
||||||
const patchedFactory: PatchedModuleFactory = function (...args: Parameters<ModuleFactory>) {
|
const patchedFactory: PatchedModuleFactory = {
|
||||||
|
PatchedFactory(...args: Parameters<ModuleFactory>) {
|
||||||
// Restore the original factory in all the module factories objects,
|
// Restore the original factory in all the module factories objects,
|
||||||
// because we want to make sure the original factory is restored properly, no matter what is the Webpack instance
|
// because we want to make sure the original factory is restored properly, no matter what is the Webpack instance
|
||||||
for (const moduleFactories of allModuleFactories) {
|
for (const moduleFactories of allModuleFactories) {
|
||||||
|
@ -418,7 +419,8 @@ function patchFactory(id: PropertyKey, factory: ModuleFactory) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return factoryReturn;
|
return factoryReturn;
|
||||||
};
|
}
|
||||||
|
}.PatchedFactory;
|
||||||
|
|
||||||
patchedFactory.toString = originalFactory.toString.bind(originalFactory);
|
patchedFactory.toString = originalFactory.toString.bind(originalFactory);
|
||||||
patchedFactory.$$vencordOriginal = originalFactory;
|
patchedFactory.$$vencordOriginal = originalFactory;
|
||||||
|
|
Loading…
Reference in a new issue