1
0

jsWorker.js 359 B

1234567891011121314151617
  1. onmessage = function (e) {
  2. let output = [];
  3. const INPUT = JSON.parse(e.data.input);
  4. try {
  5. eval(`
  6. console.log = function (str) {
  7. output.push(str)
  8. }
  9. ${e.data.code}
  10. `);
  11. } catch (e) {
  12. output.push(`Error : ${e}`);
  13. } finally {
  14. postMessage(output)
  15. }
  16. };