summaryrefslogtreecommitdiffstats
path: root/solve/static/sandbox.js
diff options
context:
space:
mode:
Diffstat (limited to 'solve/static/sandbox.js')
-rw-r--r--solve/static/sandbox.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/solve/static/sandbox.js b/solve/static/sandbox.js
new file mode 100644
index 0000000..f0d18f9
--- /dev/null
+++ b/solve/static/sandbox.js
@@ -0,0 +1,12 @@
+import { expose } from './comlink-4.3.1.js';
+
+expose({
+ run(code, errorHandler) {
+ try {
+ return eval(code);
+ } catch (error) {
+ console.log("caught!");
+ errorHandler(error);
+ }
+ }
+});