This commit is contained in:
Rizky 2024-04-20 23:29:49 +07:00
parent 70766c4ea1
commit 07b8a86376
2 changed files with 6 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -163,15 +163,16 @@ export const viEvalScript = (
try {
const fn = new Function(
...Object.keys(arg),
"___js",
`// ${meta.item.name}: ${meta.item.id}
try {
${src}
} catch(e) {
console.warn("Error at item ${meta.item.name}:", \`${meta.item.adv?.js}\`);
console.warn("Error at item ${meta.item.name}:", ___js);
}
`
);
fn(...Object.values(arg));
fn(...Object.values(arg), meta.item.adv?.js);
} catch (e) {
console.warn(`Error at item ${meta.item.name}:`, meta.item.adv?.js);
console.error(e);