diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-08-30 15:55:33 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-09-03 11:14:24 +0200 |
commit | 45b1a3f97953fac65c6aef8e46abad865a0d0bc3 (patch) | |
tree | 335037e183133e639f9f453b2443785557b27dd8 /tests/auto/qml/qqmlecmascript | |
parent | 811b15bd161d12e5c85e093f9f492a0c4fa278d6 (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.
Fixes: QTBUG-77954
Change-Id: I45ef35fab399e3f971444b96d4a9ec6a99e29e09
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/semicolonAfterProperty.qml | 10 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 11 |
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 b44fe9766c..269d90c891 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -374,6 +374,7 @@ private slots: void hugeRegexpQuantifiers(); void singletonTypeWrapperLookup(); void getThisObject(); + void semicolonAfterProperty(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -9106,6 +9107,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" |