Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy
This commit is contained in:
commit
b36d3b4385
|
@ -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