We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c53ac5 commit b275d36Copy full SHA for b275d36
src/tracers/julia/worker.js
@@ -0,0 +1,14 @@
1
+const process = { env: { ALGORITHM_VISUALIZER: '1' } };
2
+importScripts('/api/tracers/julia');
3
+
4
+const sandbox = code => {
5
+ const require = name => ({ 'algorithm-visualizer': AlgorithmVisualizer }[name]); // fake require
6
+ eval(code);
7
+};
8
9
+onmessage = e => {
10
+ const lines = e.data.split('\n').map((line, i) => line.replace(/(\.\s*delay\s*)\(\s*\)/g, `$1(${i})`));
11
+ const code = lines.join('\n');
12
+ sandbox(code);
13
+ postMessage(AlgorithmVisualizer.Commander.commands);
14
0 commit comments