diff --git a/lib/core/modules/coderunner/codeRunner.js b/lib/core/modules/coderunner/codeRunner.js index c34af412..95bc5b40 100644 --- a/lib/core/modules/coderunner/codeRunner.js +++ b/lib/core/modules/coderunner/codeRunner.js @@ -41,6 +41,10 @@ class CodeRunner { if (!cb) { cb = function() {}; } + if (code.startsWith('await')) { + code = code.substring(5); // remove await keyword + code += '.then(console.log).catch(console.error)'; // Add promise catch + } let result = RunCode.doEval(code); if (forConsoleOnly && self.ipc.isServer()) { self.commands.push({code});