remove garbage

This commit is contained in:
2023-08-10 13:20:33 +02:00
parent b6d280c031
commit 1ff0d46c8d
2 changed files with 1 additions and 77 deletions

View File

@ -1,6 +1,5 @@
import type { Editor } from './main';
import type { File } from './AppSettings';
import { parseUserCode } from './Walker';
const delay = (ms: number) => new Promise((_, reject) => setTimeout(() => reject(new Error('Operation took too long')), ms));
@ -16,7 +15,7 @@ const tryCatchWrapper = (application: Editor, code: string): Promise<boolean> =>
*/
return new Promise((resolve, _) => {
try {
Function(`with (this) {try{${parseUserCode(code)}} catch (e) {console.log(e)}};`).call(application.api);
Function(`with (this) {try{${code}} catch (e) {console.log(e)}};`).call(application.api);
resolve(true);
} catch (error) {
console.log(error);