aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/functionAssignment.2.qml20
-rw-r--r--tests/auto/qml/qqmlecmascript/data/include.js2
-rw-r--r--tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml11
-rw-r--r--tests/auto/qml/qqmlecmascript/data/signalArguments.1.qml2
-rw-r--r--tests/auto/qml/qqmlecmascript/data/signalArguments.2.qml2
-rw-r--r--tests/auto/qml/qqmlecmascript/data/v8functionException.qml15
6 files changed, 19 insertions, 33 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/functionAssignment.2.qml b/tests/auto/qml/qqmlecmascript/data/functionAssignment.2.qml
index 3d8fd85a88..943d34ca84 100644
--- a/tests/auto/qml/qqmlecmascript/data/functionAssignment.2.qml
+++ b/tests/auto/qml/qqmlecmascript/data/functionAssignment.2.qml
@@ -19,11 +19,11 @@ MyQmlObject {
property bool assignWrongType: false
property bool assignWrongTypeToValueType: false
+ function myFunction() {
+ return aNumber * 10;
+ }
onAssignToPropertyChanged: {
- function myFunction() {
- return aNumber * 10;
- }
a = Qt.binding(myFunction);
}
@@ -54,17 +54,17 @@ MyQmlObject {
// detecting errors:
+ function myEmptyFunction() {
+ }
onAssignFuncWithoutReturnChanged: {
- function myFunction() {
- }
- a = Qt.binding(myFunction);
+ a = Qt.binding(myEmptyFunction);
}
+ function myStringFunction() {
+ return 'a string';
+ }
onAssignWrongTypeChanged: {
- function myFunction() {
- return 'a string';
- }
- aNumber = Qt.binding(myFunction);
+ aNumber = Qt.binding(myStringFunction);
}
onAssignWrongTypeToValueTypeChanged: {
diff --git a/tests/auto/qml/qqmlecmascript/data/include.js b/tests/auto/qml/qqmlecmascript/data/include.js
index 232fd808f8..489e322ef0 100644
--- a/tests/auto/qml/qqmlecmascript/data/include.js
+++ b/tests/auto/qml/qqmlecmascript/data/include.js
@@ -3,6 +3,6 @@ var test2 = false
var test3 = false
function go() {
- Qt.include("js/include2.js");
+ console.log(Qt.include("js/include2.js").status);
}
diff --git a/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml b/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml
index 1143eaf919..c2325fb5ee 100644
--- a/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml
+++ b/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml
@@ -5,7 +5,8 @@ Item {
id: testOwnership
property bool test: false
- function runTest() {
+ function createComponent()
+ {
var o;
var c = Qt.createComponent("ComponentWithVarProp.qml");
if (c.status == Component.Ready) {
@@ -15,8 +16,12 @@ Item {
}
o.varprop = true; // causes initialization of varProperties.
SingletonType.QObject.trackObject(o); // stores QObject ptr
- if (SingletonType.QObject.trackedObject() == null) return; // is still valid, should have a valid v8object.
- o = new Date(); // causes object to be gc-able.
+ if (SingletonType.QObject.trackedObject() == null) return false // is still valid, should have a valid v8object.
+ return true;
+ }
+
+ function runTest() {
+ if (!createComponent()) return;
gc(); // collect object's v8object + varProperties, queues deleteLater.
if (SingletonType.QObject.trackedObject() != null) return; // v8object was previously collected.
SingletonType.QObject.setTrackedObjectProperty("varprop"); // deferences varProperties of object.
diff --git a/tests/auto/qml/qqmlecmascript/data/signalArguments.1.qml b/tests/auto/qml/qqmlecmascript/data/signalArguments.1.qml
index 3ab714b800..09fffbba36 100644
--- a/tests/auto/qml/qqmlecmascript/data/signalArguments.1.qml
+++ b/tests/auto/qml/qqmlecmascript/data/signalArguments.1.qml
@@ -2,10 +2,8 @@ import Qt.test 1.0
MyQmlObject {
property int argumentCount: -1
- property bool calleeCorrect: false
onBasicSignal: {
argumentCount = arguments.length
- calleeCorrect = (arguments.callee === onBasicSignal)
setString('pass')
}
}
diff --git a/tests/auto/qml/qqmlecmascript/data/signalArguments.2.qml b/tests/auto/qml/qqmlecmascript/data/signalArguments.2.qml
index 8ecb8df6ee..fec810fd28 100644
--- a/tests/auto/qml/qqmlecmascript/data/signalArguments.2.qml
+++ b/tests/auto/qml/qqmlecmascript/data/signalArguments.2.qml
@@ -2,11 +2,9 @@ import Qt.test 1.0
MyQmlObject {
property int argumentCount: -1
- property bool calleeCorrect: false
onArgumentSignal: {
argumentCount = arguments.length
- calleeCorrect = (arguments.callee === onArgumentSignal)
setString('pass ' + arguments[0] + ' ' + arguments[1] + ' '
+ arguments[2] + ' ' + arguments[3] + ' '
+ arguments[4])
diff --git a/tests/auto/qml/qqmlecmascript/data/v8functionException.qml b/tests/auto/qml/qqmlecmascript/data/v8functionException.qml
deleted file mode 100644
index 51df1c65d8..0000000000
--- a/tests/auto/qml/qqmlecmascript/data/v8functionException.qml
+++ /dev/null
@@ -1,15 +0,0 @@
-import QtQuick 2.0
-
-// This test uses a multi-line string which has \r-terminated
-// string fragments. The expression rewriter deliberately doesn't
-// handle \r-terminated string fragments (see QTBUG-24064) and thus
-// this test ensures that we don't crash when the client attempts
-// to invoke a non-compiled dynamic slot.
-
-Item {
- id: root
-
- function dynamicSlot() {
- var someString = "Hello, this is a multiline string";
- }
-}