stupid me
This commit is contained in:
parent
5f474ae9bc
commit
9b94e49622
1 changed files with 1 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue