[Patcher > Base] Fix error

pull/70/head
CanadaHonk 2 years ago committed by GitHub
parent fd52228e3f
commit 1ab033ae22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -113,9 +113,9 @@ export const patch = (parent, functionName, handler, before = false, instead = f
if (!modIndex[id][keyName]) {
const original = parent[functionName];
parent[functionName] = Object.assign(generateNewFunction(original, id, functionName, keyName), originalFunctionClone);
parent[functionName] = Object.assign(generateNewFunction(original, id, functionName, keyName), original);
parent[functionName].toString = () => originalFunctionClone.toString(); // You cannot just set directly a.toString = b.toString like we used to because strange internal JS prototype things, so make a new function just to run original function
parent[functionName].toString = () => original.toString(); // You cannot just set directly a.toString = b.toString like we used to because strange internal JS prototype things, so make a new function just to run original function
let toHarden = false;
if (isReactComponent(original)) toHarden = true;

Loading…
Cancel
Save