summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qmlecmascript/data/ScopeObject.qml14
-rw-r--r--tests/auto/declarative/qmlecmascript/data/scope.qml6
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp2
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/ScopeObject.qml b/tests/auto/declarative/qmlecmascript/data/ScopeObject.qml
new file mode 100644
index 0000000..b7bec63
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/ScopeObject.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Item {
+ property int a: 3
+ property int binding: myFunction();
+ property int binding2: myCompFunction();
+
+ Script {
+ function myCompFunction() {
+ return a;
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qmlecmascript/data/scope.qml b/tests/auto/declarative/qmlecmascript/data/scope.qml
index 87155d1..80222c8 100644
--- a/tests/auto/declarative/qmlecmascript/data/scope.qml
+++ b/tests/auto/declarative/qmlecmascript/data/scope.qml
@@ -31,6 +31,10 @@ Item {
property int binding4: myNestedFunction()
}
+ ScopeObject {
+ id: CompObject
+ }
+
property alias test1: Root.binding
property alias test2: NestedObject.binding
property alias test3: Root.binding2
@@ -39,4 +43,6 @@ Item {
property alias test6: NestedObject.binding3
property alias test7: Root.binding4
property alias test8: NestedObject.binding4
+ property alias test9: CompObject.binding
+ property alias test10: CompObject.binding2
}
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index 15bfe24..c69528a 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -542,6 +542,8 @@ void tst_qmlecmascript::scope()
QCOMPARE(object->property("test6").toInt(), 1);
QCOMPARE(object->property("test7").toInt(), 2);
QCOMPARE(object->property("test8").toInt(), 2);
+ QCOMPARE(object->property("test9").toInt(), 1);
+ QCOMPARE(object->property("test10").toInt(), 3);
}
/*