Fix roundtrip conversion between JS var and QVariant
authorLars Knoll <lars.knoll@digia.com>
Mon, 8 Sep 2014 12:06:22 +0000 (14:06 +0200)
committerLars Knoll <lars.knoll@digia.com>
Thu, 11 Sep 2014 07:56:48 +0000 (09:56 +0200)
commit91d6a63ab317817990c3b2306860adbd8916cca4
tree44962e20ce14c594d1f77c7ac4d54d53bd1b158e
parent8fab54a5495226b8c06d7708357a23e83444abc0
Fix roundtrip conversion between JS var and QVariant

Always convert null to a QVariant(VoidStar) as documented in
QJSValue. Make sure the reverse conversion will lead back to
a null JS value.

Adjusted two test cases that expected an invalid QVariant when
setting the property to null, and added test cases for the
correct conversion.

Task-number: QTBUG-40880
Change-Id: I6eb01f0067f2c89779c53fd2cd0a1193047ed2cc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/qqmlproperty.cpp
src/qml/qml/v8/qv8engine.cpp
tests/auto/qml/qqmlecmascript/data/scarceResourceFunction.var.qml
tests/auto/qml/qqmlecmascript/data/scarceResourceFunction.variant.qml
tests/auto/qml/qqmlecmascript/data/variants.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp