BetterDiscordApp-rauenzi/renderer/src/polyfill/vm.js

10 lines
361 B
JavaScript
Raw Normal View History

import Remote from "./remote";
2023-05-20 00:37:21 +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
};