make sure draw logic works with multiple repls

This commit is contained in:
Felix Roos 2024-06-01 15:41:55 +02:00
parent 827993a8c9
commit 375c68775c
7 changed files with 20 additions and 16 deletions

View file

@ -37,11 +37,11 @@ function safeEval(str, options = {}) {
return Function(body)();
}
export const evaluate = async (code, transpiler) => {
export const evaluate = async (code, transpiler, transpilerOptions) => {
let meta = {};
if (transpiler) {
// transform syntactically correct js code to semantically usable code
const transpiled = transpiler(code);
const transpiled = transpiler(code, transpilerOptions);
code = transpiled.output;
meta = transpiled;
}