10 lines
361 B
JavaScript
10 lines
361 B
JavaScript
import Remote from "./remote";
|
|
|
|
|
|
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;
|
|
}; |