diff options
author | Nicolas Arnaud-Cormos <nicolas.arnaud-cormos.qnx@kdab.com> | 2012-05-15 17:02:42 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-25 08:15:46 (GMT) |
commit | a3a7553dd52a90a95cfeef80d36b1fd671b335b2 (patch) | |
tree | 0465e36ac5cccbfc973dae80dc3b3b1ed5a5cc78 /tests | |
parent | 8f22e4bed8973758ef175f4d5d7f725009db9eb6 (diff) | |
download | Qt-a3a7553dd52a90a95cfeef80d36b1fd671b335b2.zip Qt-a3a7553dd52a90a95cfeef80d36b1fd671b335b2.tar.gz Qt-a3a7553dd52a90a95cfeef80d36b1fd671b335b2.tar.bz2 |
Fix crash when using aliases and variants
Right now, the parser crash when using id.variant.property for an alias.
The current patch fix the crash, and it displays an error message in
the console now (like QtQuick 2).
Task-number: QTBUG-25341
Change-Id: I5e2c13f487655fd2b90129c5693f5daf3f77984b
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'tests')
3 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.11.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.11.errors.txt new file mode 100644 index 0000000..b94e92c --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.11.errors.txt @@ -0,0 +1 @@ +8:25:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.11.qml new file mode 100644 index 0000000..25efe28 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.11.qml @@ -0,0 +1,9 @@ +import QtQuick 1.0 + +QtObject { + id: main + property variant v: Text{ + text: "variant text" + } + property alias foo: main.v.text +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index bfc0a5f..c8f26d5 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -385,6 +385,7 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("invalidAlias.8") << "invalidAlias.8.qml" << "invalidAlias.8.errors.txt" << false; QTest::newRow("invalidAlias.9") << "invalidAlias.9.qml" << "invalidAlias.9.errors.txt" << false; QTest::newRow("invalidAlias.10") << "invalidAlias.10.qml" << "invalidAlias.10.errors.txt" << false; + QTest::newRow("invalidAlias.11") << "invalidAlias.11.qml" << "invalidAlias.11.errors.txt" << false; QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false; QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false; |