Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.11.0
-
None
-
* Manjaro Linux (Kernel Version 4.17.0)
* gcc 8.1.1
* Qt 5.11.0
-
c69f3d768697eed57c40317bad8a3e8ce3a1a32a
Description
With the update to Qt 5.11.0 a compiled statemachine with an ecmascript datamodel procudes the following warning:
Warning: Using function expressions as statements in scripts in not compliant with the ECMAScript specification at "function(id){return _x.inState(id);}..." This will throw a syntax error in Qt 5.12. If you want a function expression, surround it by parentheses.
This warning is produced once on initialization of the statemachine. I attached a minimal project include an SCXML file this happens for. It seems to be unproblematic for Qt 5.11, as the machine works as inteded - but juding by the warning this will not be the case once we reach Qt 5.12
The statemachine contains a very basic ecmascript datamodel (only has a single property) this seems to be the origin of that error, as after removing it the warning disappears:
<?xml version="1.0" encoding="UTF-8"?> <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="early" xmlns:qt="http://www.qt.io/2015/02/scxml-ext" datamodel="ecmascript" name="ConnectorStateMachine" qt:editorversion="4.6.2"> <datamodel> <data id="isClosing" expr="false"/> </datamodel> <state id="Active"> <qt:editorinfo geometry="0;0;-60;-50;120;100" scenegeometry="0;0;-60;-50;120;100"/> </state> </scxml>