add blank OSCConnection

This commit is contained in:
2023-08-06 10:09:10 +02:00
parent 095ba9dd4e
commit 6ad8fa114b
4 changed files with 21 additions and 21 deletions

View File

@ -1,5 +1,6 @@
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));
@ -15,7 +16,7 @@ const tryCatchWrapper = (application: Editor, code: string): Promise<boolean> =>
*/
return new Promise((resolve, _) => {
try {
Function(`with (this) {try{${code}} catch (e) {console.log(e)}};`).call(application.api);
Function(`with (this) {try{${parseUserCode(code)}} catch (e) {console.log(e)}};`).call(application.api);
resolve(true);
} catch (error) {
console.log(error);