Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.6.2, 5.9
-
None
Description
Consider the following snippet:
test.qml
import QtQuick 2.6 Rectangle { id: root color: "red" height: 500 width: 500 signal doit(var arguments) onDoit: { console.warn("json: " + JSON.stringify(arguments)); } MouseArea { anchors.fill: parent onClicked: { doit({item: "test", params: { asdf: "fdsa", x: 4 } }); } } }
In this code, the "arguments" has different semantics when interpreted than when it is compiled with QtQuick compiler.
Output when QtQuick compiled (note the "0"):
Warning (qml): test.qml:13: json: {"0":{"item":"test","params":{"asdf":"fdsa","x":4}}}
Output when interpreted:
Warning (qml): test.qml:13 (in onDoit): json: {"item":"test","params":{"asdf":"fdsa","x":4}}
Looks like QtQuick Compiler treats "arguments" as the JavaScript Arguments object, whereas interpreter treats it as the parameter name.