3 ms·
According to the docs (https://doc.qt.io/qt-5/whatsnew512.html https://doc.qt.io/qt-5/whatsnew512.html): "The JavaScript engine now supports ECMAScript 7. This
by nocman 7y ago
According to the docs (https://doc.qt.io/qt-5/whatsnew512.html https://doc.qt.io/qt-5/whatsnew512.html):
"The JavaScript engine now supports ECMAScript 7. This includes an upgrade to ECMAScript 6"
and:
"ECMAScript modules can now be loaded directly with QJSEngine::importModule() [ https://doc.qt.io/qt-5/qjsengine.html#importModule https://doc.qt.io/qt-5/qjsengine.html#importModule] and imported in .qml files when using the .mjs file extension."
Although, it looks like the ECMAScript 7 support might be incomplete, with Promises perhaps being buggy and arrow functions perhaps not working: https://forum.qt.io/topic/100526/what-parts-of-ecmascript-7-are-supported-in-qt-5-12 https://forum.qt.io/topic/100526/what-parts-of-ecmascript-7-...
Looks like transpiling with Babel works fairly well for a lot of things
relevant discussion: https://bugreports.qt.io/browse/QTBUG-47735 https://bugreports.qt.io/browse/QTBUG-47735