File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,9 +42,13 @@ import _ from 'lodash';
4242
4343const consoleRegex = /console\.(log|debug|info|warn|error|table|trace|group|groupEnd|time|timeEnd)\s*\([^;]*\);?/g;
4444
45+ async function ExecutronExecuteJsCode() {
46+ %s
47+ }
48+
4549try {
46- const result = await eval('(async () => { %s })()');
47- console.log(JSON.stringify({ result: result.toString() }));
50+ const result = await ExecutronExecuteJsCode()
51+ console.log(JSON.stringify({ result: result.toString().replace(consoleRegex, '') }));
4852} catch (e) {
4953 console.log(JSON.stringify({ error: e.message }));
5054}
7377}
7478
7579func createPyContext (code string ) * containerContext {
76- codeLines := []string {}
80+ var codeLines []string
7781 for _ , line := range strings .Split (code , "\n " ) {
7882 codeLines = append (codeLines , fmt .Sprintf (" %s" , line ))
7983 }
You can’t perform that action at this time.
0 commit comments