提交 ece28477 编写于 作者: J Jason Park

Remove babel

上级 c5f58e89
const process = { env: { ALGORITHM_VISUALIZER: '1' } };
importScripts('https://unpkg.com/algorithm-visualizer@latest/dist/algorithm-visualizer.js');
importScripts('https://unpkg.com/babel-standalone@6/babel.min.js');
const sandbox = code => {
const require = name => ({ 'algorithm-visualizer': AlgorithmVisualizer }[name]); // fake require
......@@ -9,7 +8,7 @@ const sandbox = code => {
onmessage = e => {
const lines = e.data.split('\n').map((line, i) => line.replace(/(.+\. *delay *)(\( *\))/g, `$1(${i})`));
const { code } = Babel.transform(lines.join('\n'), { presets: ['es2015'] });
const code = lines.join('\n');
sandbox(code);
postMessage(AlgorithmVisualizer.Tracer.traces);
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册