2022-09-26 09:01:16 +02:00
|
|
|
import Remote from "./remote";
|
|
|
|
|
2023-05-20 00:37:21 +02:00
|
|
|
|
2022-09-26 09:01:16 +02:00
|
|
|
export const compileFunction = function(code, params = [], options = {}) {
|
|
|
|
const returned = Remote.vm.compileFunction(code, params, options);
|
|
|
|
if (typeof(returned) === "function") return returned;
|
|
|
|
const syntaxError = new SyntaxError(returned.message);
|
|
|
|
syntaxError.stack = returned.stack;
|
|
|
|
throw syntaxError;
|
2022-09-06 05:58:16 +02:00
|
|
|
};
|