Modify JS Object to QVariant conversion
authorChris Adams <christopher.adams@nokia.com>
Mon, 26 Sep 2011 04:25:36 +0000 (14:25 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 30 Sep 2011 08:37:05 +0000 (10:37 +0200)
commit20fb62f6040ad8415828092a2b09bd374433505f
treedab84177a83c9e8c9e2d95c8025fd4f7aed2116e
parent54c1fa834aae16fc98fe2f9a3d2a93adc93254df
Modify JS Object to QVariant conversion

Previously, JS Objects would be converted to a QVariantMap where
each value in the map was a QVariant from toVariant(propertyValue).
Unfortunately, this would result in a crash if the object had a
reference to another object which had a reference to the original
object, due to the circular reference.

This commit changes the conversion code to use
QV8Engine::variantMapFromJS() instead, which avoids cyclic references.

Task-number: QTBUG-21626
Change-Id: I129048c8704ae0d1095a02d0ce4c0fe5850b1b20
Reviewed-on: http://codereview.qt-project.org/5490
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
src/declarative/qml/v8/qv8engine.cpp
tests/auto/declarative/qdeclarativeecmascript/data/objectConversion.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp