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:
2024-02-22 07:55:22 +01:00
parent d952a69c80
commit a80576f231
2 changed files with 4 additions and 1 deletions
+1 -1
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")) {
+3
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, {