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);
|
||||
}
|
||||
|
||||
// The patched factory wrapper
|
||||
const patchedFactory: PatchedModuleFactory = function (...args: Parameters<ModuleFactory>) {
|
||||
// The patched factory wrapper, define it in an object to preserve the name after minification
|
||||
const patchedFactory: PatchedModuleFactory = {
|
||||
PatchedFactory(...args: Parameters<ModuleFactory>) {
|
||||
// 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
|
||||
for (const moduleFactories of allModuleFactories) {
|
||||
|
@ -418,7 +419,8 @@ function patchFactory(id: PropertyKey, factory: ModuleFactory) {
|
|||
}
|
||||
|
||||
return factoryReturn;
|
||||
};
|
||||
}
|
||||
}.PatchedFactory;
|
||||
|
||||
patchedFactory.toString = originalFactory.toString.bind(originalFactory);
|
||||
patchedFactory.$$vencordOriginal = originalFactory;
|
||||
|
|
Loading…
Reference in a new issue