Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy

This commit is contained in:
Nuckyz 2024-05-24 08:02:04 -03:00
commit ef895e787a
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
2 changed files with 11 additions and 6 deletions

View file

@ -17,9 +17,7 @@ type PatchedModuleFactory = ModuleFactory & {
$$vencordOriginal?: ModuleFactory;
};
type PatchedModuleFactories = Record<PropertyKey, PatchedModuleFactory> & {
[Symbol.toStringTag]?: string;
};
type PatchedModuleFactories = Record<PropertyKey, PatchedModuleFactory>;
const logger = new Logger("WebpackInterceptor", "#8caaee");
@ -140,7 +138,11 @@ Object.defineProperty(Function.prototype, "m", {
allModuleFactories.add(moduleFactories);
moduleFactories[Symbol.toStringTag] = "ModuleFactories";
Object.defineProperty(moduleFactories, Symbol.toStringTag, {
value: "ModuleFactories",
configurable: true,
writable: true
});
moduleFactories = new Proxy(moduleFactories, moduleFactoriesHandler);
}

View file

@ -88,8 +88,11 @@ export function _initWebpack(webpackRequire: WebpackRequire) {
wreq = webpackRequire;
cache = webpackRequire.c;
// @ts-ignore
webpackRequire.c[Symbol.toStringTag] = "ModuleCache";
Object.defineProperty(webpackRequire.c, Symbol.toStringTag, {
value: "ModuleCache",
configurable: true,
writable: true
});
}
let devToolsOpen = false;