stupid me

This commit is contained in:
Vendicated 2026-05-12 18:16:47 +02:00
parent 5f474ae9bc
commit 9b94e49622
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -130,7 +130,7 @@ export function PatchPreview({ module, match, replacement, setReplacementError }
try {
const isArrowFunction = patchedCode.startsWith("(");
const wrappedCode = "0," + (!isArrowFunction ? "function" : "") + patchedCode.slice(patchedCode.indexOf("("));
Function(wrappedCode.replace(/^(?=function\()/, "0,"));
Function(wrappedCode);
setCompileResult([true, "Compiled successfully"]);
} catch (err) {