Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5
-
None
-
1bd18723f (dev)
Description
The snippet below works with Qt 5 and 6.2, but not with Qt 6.5. https://jshint.com/ claims this code is OK - but QML in Qt 6.5 says no:
qt.qml.compiler: /home/andrhans/tmp/jstest/main.qml:8:30 Variable "exec" is used before its declaration at 16:17. QQmlComponent: Component is not ready qml: Did not load any objects, exiting.
Snippet:
import QtQuick MouseArea { onClicked: () => { var operatorMap = { 'and': function(context, params) { params = exec(context, params); if (!params) { /* do something */ } return true; } }; var exec = function(context, query) { /* do stuff */ }; operatorMap.and(1, 2); } }