Fixes Sources interceptor and names Patcher function (#1647)

* Make patches easily spotted as opposed to 'anonymous'

* reset source back to original method instead of getting the interceptor back in `BdApi.Webpack.modules`

* fixes d5ce64
This commit is contained in:
Skamt 2024-02-22 07:55:22 +01:00 committed by GitHub
parent 28b8c15e7f
commit f986a7fc4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -50,7 +50,7 @@
}
static makeOverride(patch) {
return function () {
return function BDPatcher() {
let returnValue;
if (!patch.children || !patch.children.length) return patch.originalFunction.apply(this, arguments);
for (const superPatch of patch.children.filter(c => c.type === "before")) {

View File

@ -524,6 +524,9 @@ export default class WebpackModules {
catch (error) {
Logger.stacktrace("WebpackModules", "Could not patch pushed module", error);
}
finally{
require.m[moduleId] = originalModule;
}
};
Object.assign(modules[moduleId], originalModule, {