add overloads

This commit is contained in:
Jiiks 2018-03-16 02:18:27 -03:00
parent f6d994e6a4
commit 86528a3335
1 changed files with 2 additions and 0 deletions

View File

@ -62,6 +62,7 @@ export default class Patcher {
return this.patches[id] = patch;
}
static get before() { return this.superpatch; }
static superpatch(unresolveModule, functionName, callback, displayName) {
const module = this.resolveModule(unresolveModule);
if (!module || !module[functionName] || !(module[functionName] instanceof Function)) return null;
@ -81,6 +82,7 @@ export default class Patcher {
return superPatch;
}
static get after() { return this.slavepatch; }
static slavepatch(unresolveModule, functionName, callback, displayName) {
const module = this.resolveModule(unresolveModule);
if (!module || !module[functionName] || !(module[functionName] instanceof Function)) return null;