aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2019-08-30 15:55:33 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2019-09-24 13:04:28 +0200
commit2f16944d45e1ade14ad086a547a9673b1ceba7bc (patch)
treeffe41e563ee202d985ff8816264d8b381fb2eb23 /tests
parentee8f5482d6ba8ffa0faf2bbf25569d59f3467fc8 (diff)
Allow semicolon after property declaration
Most of the rules already had Semicolon at the end, however it was missing for UiScriptStatement, list properties and UiObjectInitializer. This change fixes the regression from 5.11.3 to 5.12.0, and keeps the behavior consistent. (Semicolon was only introduced in 5.14, that why we need to introduce the rule in 5.12 first) Fixes: QTBUG-77954 Change-Id: I45ef35fab399e3f971444b96d4a9ec6a99e29e09 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 45b1a3f97953fac65c6aef8e46abad865a0d0bc3)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/semicolonAfterProperty.qml10
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp11
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/semicolonAfterProperty.qml b/tests/auto/qml/qqmlecmascript/data/semicolonAfterProperty.qml
new file mode 100644
index 0000000000..0a75ea6f36
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/semicolonAfterProperty.qml
@@ -0,0 +1,10 @@
+import QtQml 2.0
+
+QtObject {
+ property var field: { "key": "value"};
+ property list<QtObject> mylist: [
+ QtObject {id: a},
+ QtObject {id: b}
+ ];
+ property var object: QtObject {};
+}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 15bd9584df..dc8ef232c1 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -372,6 +372,7 @@ private slots:
void hugeRegexpQuantifiers();
void singletonTypeWrapperLookup();
void getThisObject();
+ void semicolonAfterProperty();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -9054,6 +9055,16 @@ void tst_qqmlecmascript::getThisObject()
QTRY_COMPARE(qvariant_cast<QObject *>(test->property("self")), test.data());
}
+// QTBUG-77954
+void tst_qqmlecmascript::semicolonAfterProperty()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("semicolonAfterProperty.qml"));
+ QVERIFY(component.isReady());
+ QScopedPointer<QObject> test(component.create());
+ QVERIFY(!test.isNull());
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"