mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-02 10:25:21 +00:00
simple implementation of await
This commit is contained in:
parent
b4e118c85b
commit
8ebe55f457
@ -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});
|
||||
|
Loading…
x
Reference in New Issue
Block a user