SUMMARY kwin scripting despite having support and working with promise and thenable objects under kwin. Does not seem to recognise the operator 'await' or 'async' declarations which are features of ES6 along with the mentioned thenables and the class syntax. Both of which I use in my kwin script. Instead of just working I get syntax errors in the console saying that the specific line is missing a semicolon or comma. STEPS TO REPRODUCE 1. type something like: ``` async function() { } ``` or like: ``` const variable = await Promise.race([myFunc(500), myAsyncFunc()]); ``` in the plasmainteractive console. 2. Open up a journalctl listener with: ``` journalctl -f QT_CATEGORY=js QT_CATEGORY=kwin_scripting ``` 3. And execute the scripting using the kwin environment setting in the interactive console. OBSERVED RESULT Outputs these errors in the console: ``` Dec 16 20:48:52 TRKY2 kwin_x11[1095]: kwin_scripting: /home/s/.local/share/plasma-interactiveconsole/interactiveconsoleautosave.js:65: error: Expected token `,' Dec 16 20:49:13 TRKY2 kwin_x11[1095]: kwin_scripting: /home/s/.local/share/plasma-interactiveconsole/interactiveconsoleautosave.js:60: error: Expected token `;' ``` EXPECTED RESULT Executing the code asynchronously with expected behavior. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.113.0 Qt Version: 5.15.11 Kernel Version: 6.6.7-arch1-1 (64-bit) Graphics Platform: X11 Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor Memory: 31.3 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 1080/PCIe/SSE2 Manufacturer: Gigabyte Technology Co., Ltd. Product Name: X570 AORUS ELITE System Version: -CF ADDITIONAL INFORMATION bug report 447922 seems to be the same issue however it is slightly different as lambda functions do seem to work for me and it doesnt mention 'await'
QJSEngine, which KWin uses for the script evaluation, doesn't support async/await. See https://bugreports.qt.io/browse/QTBUG-58620