fix eval
This commit is contained in:
parent
88bbf4622c
commit
603b305234
|
|
@ -146,7 +146,9 @@ export const viEvalScript = (
|
||||||
_jsx: true;
|
_jsx: true;
|
||||||
fn: (arg: { passprop: any; meta: IMeta }) => ReactNode;
|
fn: (arg: { passprop: any; meta: IMeta }) => ReactNode;
|
||||||
};
|
};
|
||||||
arg[k] = <JsxProp fn={jprop.fn} passprop={{ ...passprop }} meta={meta} />;
|
arg[k] = (
|
||||||
|
<JsxProp fn={jprop.fn} passprop={{ ...passprop }} meta={meta} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -162,7 +164,11 @@ export const viEvalScript = (
|
||||||
const fn = new Function(
|
const fn = new Function(
|
||||||
...Object.keys(arg),
|
...Object.keys(arg),
|
||||||
`// ${meta.item.name}: ${meta.item.id}
|
`// ${meta.item.name}: ${meta.item.id}
|
||||||
|
try {
|
||||||
${src}
|
${src}
|
||||||
|
} catch(e) {
|
||||||
|
console.warn("Error at item ${meta.item.name}:", ${meta.item.adv?.js});
|
||||||
|
}
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
fn(...Object.values(arg));
|
fn(...Object.values(arg));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue