aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit885735d011472bcfbb96e688d9e64553d7fe9d4b (patch)
tree734963625eba643bf11bc4870a4c407809a6400a /tests/auto/declarative/qdeclarativeecmascript/data
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml59
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml28
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml26
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/blank.js0
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml48
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml25
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/eval.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exception.js1
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/function.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml73
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js17
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/in.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include.js8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js26
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml21
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js3
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml36
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml26
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js1
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml40
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.qml44
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml16
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js3
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml17
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml16
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml17
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml46
157 files changed, 2130 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml
new file mode 100644
index 0000000000..0eda67d51a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property real realProperty
+ property alias aliasProperty: root.realProperty
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml
new file mode 100644
index 0000000000..f539fb62b4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyTypeObject {
+ id: root
+
+ property int data: 7
+
+ property int targetProperty: root.data * 43 - root.data
+ property alias aliasProperty: root.targetProperty
+
+ pointProperty: Qt.point(data, data);
+ property alias pointAliasProperty: root.pointProperty
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml
new file mode 100644
index 0000000000..a4b0527436
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property int testProperty
+ property alias aliasProperty: root.testProperty
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml
new file mode 100644
index 0000000000..07bb16b0d8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml
@@ -0,0 +1,12 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property int c1: 0
+ property int c2: c1
+ property alias c3: inner.ic1
+
+ objectProperty: MyQmlObject {
+ id: inner
+ property int ic1: c1
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml
new file mode 100644
index 0000000000..4a42518575
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property string greeting: "hello world"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml
new file mode 100644
index 0000000000..829d405c3c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ function testFunction() { return 19; }
+ function testFunction2() { return 18; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
new file mode 100644
index 0000000000..f542c64a91
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+QtObject {
+ property int b: obj.prop.a
+
+ property variant prop;
+ prop: QtObject {
+ property int a: 10
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml
new file mode 100644
index 0000000000..df494af5a1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Item {
+ property int a: 3
+ property int binding: myFunction();
+ property int binding2: myCompFunction();
+
+ function myCompFunction() {
+ return a;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml
new file mode 100644
index 0000000000..3427a3b27a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ property int children: root.children.length
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml b/tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml
new file mode 100644
index 0000000000..56e06252c4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml
@@ -0,0 +1,2 @@
+import Qt.test 1.0
+MyQmlObject{objectName:"objectThree"}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml
new file mode 100644
index 0000000000..f0808c4cb8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml
@@ -0,0 +1,59 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property bool test: false
+
+ property real testData: 9
+ property real testData2: 9
+
+ states: State {
+ name: "change"
+ PropertyChanges {
+ target: myType
+ realProperty: if (testData2 > 3) 9; else 11;
+ }
+ }
+
+ AliasBindingsAssignCorrectlyType {
+ id: myType
+
+ aliasProperty: if (testData > 3) 14; else 12;
+ }
+
+ Component.onCompleted: {
+ // Check original binding works
+ if (myType.aliasProperty != 14) return;
+
+ testData = 2;
+ if (myType.aliasProperty != 12) return;
+
+ // Change binding indirectly by modifying the "realProperty"
+ root.state = "change";
+ if (myType.aliasProperty != 9) return;
+
+ // Check the new binding works
+ testData2 = 1;
+ if (myType.aliasProperty != 11) return;
+
+ // Try and trigger the old binding (that should have been removed)
+ testData = 6;
+ if (myType.aliasProperty != 11) return;
+
+ // Restore the original binding
+ root.state = "";
+ if (myType.aliasProperty != 14) return;
+
+ // Test the restored binding works
+ testData = 0;
+ if (myType.aliasProperty != 12) return;
+
+ // Test the old binding isn't somehow hanging around and still in effect
+ testData2 = 13;
+ if (myType.aliasProperty != 12) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml
new file mode 100644
index 0000000000..4f07cbf616
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ pointAliasProperty.x: me.value
+ }
+
+ Component.onCompleted: {
+ if (aliasType.pointAliasProperty.x != 9) return;
+
+ me.value = 11;
+ if (aliasType.pointAliasProperty.x != 11) return;
+
+ aliasType.data = 8;
+ if (aliasType.pointAliasProperty.x != 11) return;
+
+ me.value = 4;
+ if (aliasType.pointAliasProperty.x != 4) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml
new file mode 100644
index 0000000000..937ae91c9b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property bool test: false;
+
+ property int value1: 10
+ property int value2: 11
+
+ AliasBindingsOverrideTargetType3 {
+ id: obj
+
+ testProperty: root.value1 * 9
+ aliasProperty: root.value2 * 10
+ }
+
+ Component.onCompleted: {
+ if (obj.testProperty != 110) return;
+ if (obj.aliasProperty != 110) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml
new file mode 100644
index 0000000000..a01dc5b0b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ aliasProperty: me.value
+ }
+
+ Component.onCompleted: {
+ if (aliasType.aliasProperty != 9) return;
+
+ me.value = 11;
+ if (aliasType.aliasProperty != 11) return;
+
+ aliasType.data = 8;
+ if (aliasType.aliasProperty != 11) return;
+
+ me.value = 4;
+ if (aliasType.aliasProperty != 4) return;
+
+ test = true;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml
new file mode 100644
index 0000000000..da6c795b12
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ property alias c1: myObject.c1
+ property int c2: 3
+ property int c3: c2
+ objectProperty: QtObject {
+ id: myObject
+ property int c1
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml
new file mode 100644
index 0000000000..5bf9f6a2ed
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ }
+
+ Component.onCompleted: {
+ if (aliasType.aliasProperty != 294) return;
+
+ aliasType.data = 8;
+ if (aliasType.aliasProperty != 336) return;
+
+ aliasType.aliasProperty = 4;
+ if (aliasType.aliasProperty != 4) return;
+
+ aliasType.data = 7;
+ if (aliasType.aliasProperty != 4) return;
+
+ test = true;
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml
new file mode 100644
index 0000000000..a23ad4a0dd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ pointAliasProperty.x: 9
+ }
+
+ Component.onCompleted: {
+ if (aliasType.pointAliasProperty.x != 9) return;
+
+ aliasType.data = 8;
+ if (aliasType.pointAliasProperty.x != 9) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml
new file mode 100644
index 0000000000..ac20371472
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ aliasProperty: 11
+ }
+
+ Component.onCompleted: {
+ if (aliasType.aliasProperty != 11) return;
+
+ aliasType.data = 8;
+ if (aliasType.aliasProperty != 11) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml
new file mode 100644
index 0000000000..2c79729651
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml
@@ -0,0 +1,26 @@
+import Qt.test 1.0
+
+MyTypeObject {
+ flagProperty: if(1) "FlagVal1 | FlagVal3"
+ enumProperty: if(1) "EnumVal2"
+ stringProperty: if(1) "Hello World!"
+ uintProperty: if(1) 10
+ intProperty: if(1) -19
+ realProperty: if(1) 23.2
+ doubleProperty: if(1) -19.75
+ floatProperty: if(1) 8.5
+ colorProperty: if(1) "red"
+ dateProperty: if(1) "1982-11-25"
+ timeProperty: if(1) "11:11:32"
+ dateTimeProperty: if(1) "2009-05-12T13:22:01"
+ pointProperty: if(1) "99,13"
+ pointFProperty: if(1) "-10.1,12.3"
+ sizeProperty: if(1) "99x13"
+ sizeFProperty: if(1) "0.1x0.2"
+ rectProperty: if(1) "9,7,100x200"
+ rectFProperty: if(1) "1000.1,-10.9,400x90.99"
+ boolProperty: if(1) true
+ variantProperty: if(1) "Hello World!"
+ vectorProperty: if(1) "10,1,2.2"
+ urlProperty: if(1) "main.qml"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml
new file mode 100644
index 0000000000..9443c01d50
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml
@@ -0,0 +1,29 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyTypeObject {
+ Component.onCompleted: {
+ flagProperty = "FlagVal1 | FlagVal3"
+ enumProperty = "EnumVal2"
+ stringProperty = "Hello World!"
+ uintProperty = 10
+ intProperty = -19
+ realProperty = 23.2
+ doubleProperty = -19.75
+ floatProperty = 8.5
+ colorProperty = "red"
+ dateProperty = "1982-11-25"
+ timeProperty = "11:11:32"
+ dateTimeProperty = "2009-05-12T13:22:01"
+ pointProperty = "99,13"
+ pointFProperty = "-10.1,12.3"
+ sizeProperty = "99x13"
+ sizeFProperty = "0.1x0.2"
+ rectProperty = "9,7,100x200"
+ rectFProperty = "1000.1,-10.9,400x90.99"
+ boolProperty = true
+ variantProperty = "Hello World!"
+ vectorProperty = "10,1,2.2"
+ urlProperty = "main.qml"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml
new file mode 100644
index 0000000000..a7184c9200
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml
@@ -0,0 +1,22 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ property alias a: me.a
+ property alias b: me.a
+ property alias c: me.a
+ property alias d: me.a
+
+ property MyQmlObject obj
+ obj: MyQmlObject {
+ MyQmlObject.value2: 13
+
+ id: me
+ property int a: MyQmlObject.value2 * 2
+ property int b: Namespace.MyQmlObject.value2 * 2
+ property int c: me.Namespace.MyQmlObject.value * 2
+ property int d: me.Namespace.MyQmlObject.value * 2
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml
new file mode 100644
index 0000000000..061eda0e54
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ id: me
+ property int a: MyQmlObject.value
+ property int b: Namespace.MyQmlObject.value
+ property int c: me.Namespace.MyQmlObject.value
+ property int d: me.Namespace.MyQmlObject.value
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml
new file mode 100644
index 0000000000..c66ef6939e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+QtObject {
+ property int value: 9
+ property int value2
+
+ MyQmlObject.onMySignal: value2 = value
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml b/tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml
new file mode 100644
index 0000000000..80545cf72b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml
@@ -0,0 +1,14 @@
+import Qt.test 1.0
+
+MyQmlContainer {
+ children : [
+ MyQmlObject {
+ id: object1
+ stringProperty: "hello" + object2.stringProperty
+ },
+ MyQmlObject {
+ id: object2
+ stringProperty: "hello" + object1.stringProperty
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/blank.js b/tests/auto/declarative/qdeclarativeecmascript/data/blank.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/blank.js
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml
new file mode 100644
index 0000000000..3147f63989
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ stringProperty: trueProperty?'pass':'fail'
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml
new file mode 100644
index 0000000000..c89bb49b45
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ stringProperty: falseProperty?'fail':'pass'
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml
new file mode 100644
index 0000000000..68dbcfad97
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ property int a: 10
+ property bool b: false
+
+ property int test
+
+ test: ((a == 10)?(a + 1):0) + ((b == true)?9:3)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml
new file mode 100644
index 0000000000..3fd9131b2f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml
@@ -0,0 +1,9 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property bool runTest: false
+
+ property variant a: MyQmlObject {}
+
+ objectProperty: (runTest == false)?a:null
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml
new file mode 100644
index 0000000000..0f23297570
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ objectProperty: MyQmlObject {}
+
+ Component.onCompleted: {
+ objectProperty = null;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
new file mode 100644
index 0000000000..58b7adb841
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
@@ -0,0 +1,48 @@
+import QtQuick 1.0
+
+QtObject {
+ //real
+ property real test1: a + b
+ property real test2: a - b
+ property bool test3: (a < b)
+ property bool test4: (a > b)
+ property bool test5: (a == b)
+ property bool test6: (a != b)
+
+ //int
+ property int test7: c + d
+ property int test8: d - c
+ property bool test9: (c < d)
+ property bool test10: (c > d)
+ property bool test11: (c == d)
+ property bool test12: (c != d)
+
+ //string
+ property string test13: e + f
+ property string test14: e + " " + f
+ property bool test15: (e == f)
+ property bool test16: (e != f)
+
+ //type conversion
+ property int test17: a
+ property real test18: d
+ property int test19: g
+ property real test20: g
+ property string test21: g
+ property string test22: h
+ property bool test23: i
+ property color test24: j
+ property color test25: k
+
+ property real a: 4.5
+ property real b: 11.2
+ property int c: 9
+ property int d: 176
+ property string e: "Hello"
+ property string f: "World"
+ property variant g: 6.7
+ property variant h: "!"
+ property variant i: true
+ property string j: "#112233"
+ property string k: "#aa112233"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml
new file mode 100644
index 0000000000..1af77d5aff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property CustomObject myObject
+ myObject: CustomObject { }
+
+ Component.onCompleted: console.log(myObject.greeting)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml
new file mode 100644
index 0000000000..13c5ae5fff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property int c1: 0
+ property int c2: c1
+
+ onBasicSignal: c2 = 13
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml
new file mode 100644
index 0000000000..207a06b700
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property alias c1: myConstants.c1
+ property alias c2: myConstants.c2
+
+ objectProperty: ConstantsOverrideBindings {
+ id: myConstants
+ c2: 10
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml
new file mode 100644
index 0000000000..ca9d1d8ab9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property int c1: 0
+ property int c2: c1
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml
new file mode 100644
index 0000000000..5a2091f71c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property alias c1: myConstants.c1
+ property alias c3: myConstants.c3
+
+ objectProperty: ConstantsOverrideBindings {
+ id: myConstants
+ c3: 10
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml b/tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml
new file mode 100644
index 0000000000..ac296ce293
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "objName"
+ function testToString()
+ {
+ obj.stringProperty = obj.toString();
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml
new file mode 100644
index 0000000000..e01f708a07
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+
+MyDeferredObject {
+ id: root
+ value: 10
+ objectProperty: MyQmlObject {
+ value: root.value
+ }
+ objectProperty2: MyQmlObject { id: blah }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml
new file mode 100644
index 0000000000..18a57ba625
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyDeferredObject {
+ value: undefined // error is resolved before complete
+ objectProperty: undefined // immediate error
+ objectProperty2: QtObject {
+ Component.onCompleted: value = 10
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml
new file mode 100644
index 0000000000..131fa6f2b8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+ property bool test: false
+
+ Component.onCompleted: {
+ try {
+ root.deleteLater()
+ } catch(e) {
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
new file mode 100644
index 0000000000..4de405dcce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+QtObject {
+ function calculate() {
+ return b * 13;
+ }
+
+ property int a: calculate()
+ property int b: 3
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
new file mode 100644
index 0000000000..7ba51ef068
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+QtObject {
+ property variant obj
+ obj: MyQmlObject {
+ id: myObject
+ value: 92
+ }
+
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+ property bool test4: false
+
+ Component.onCompleted: {
+ test1 = myObject.value == 92;
+ test2 = obj.value == 92;
+
+ myObject.deleteOnSet = 1;
+
+ test3 = myObject == null
+ test4 = obj == null
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml
new file mode 100644
index 0000000000..d790d634e9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ objectName: "objectTwo"
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml
new file mode 100644
index 0000000000..7b132e1edf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml
@@ -0,0 +1,27 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "obj"
+ function createOne()
+ {
+ obj.objectProperty = Qt.createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"objectOne"}', obj);
+ }
+
+ function createTwo()
+ {
+ var component = Qt.createComponent('dynamicCreation.helper.qml');
+ obj.objectProperty = component.createObject(obj);
+ }
+
+ function createThree()
+ {
+ obj.objectProperty = Qt.createQmlObject('TypeForDynamicCreation{}', obj);
+ }
+
+ function dontCrash()
+ {
+ var component = Qt.createComponent('file-doesnt-exist.qml');
+ obj.objectProperty = component.createObject(obj);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml
new file mode 100644
index 0000000000..f41e5262fd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "obj"
+ function create()
+ {
+ obj.objectProperty = Qt.createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"emptyObject"}', obj);
+ }
+
+ function killOther()
+ {
+ obj.objectProperty.destroy(500);
+ }
+
+ function killMe()
+ {
+ obj.destroy();//Must not segfault
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml
new file mode 100644
index 0000000000..6351823230
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ // Enums from non-namespaced type
+ property int a: MyQmlObject.EnumValue1
+ property int b: MyQmlObject.EnumValue2
+ property int c: MyQmlObject.EnumValue3
+ property int d: MyQmlObject.EnumValue4
+
+ // Enums from namespaced type
+ property int e: Namespace.MyQmlObject.EnumValue1
+ property int f: Namespace.MyQmlObject.EnumValue2
+ property int g: Namespace.MyQmlObject.EnumValue3
+ property int h: Namespace.MyQmlObject.EnumValue4
+
+ // Test that enums don't mask attached properties
+ property int i: MyQmlObject.value
+ property int j: Namespace.MyQmlObject.value
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml
new file mode 100644
index 0000000000..bdc672fadc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ property int a: MyQmlObject.EnumValue10
+ property int b: Namespace.MyQmlObject.EnumValue10
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
new file mode 100644
index 0000000000..661cd5c4d9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test1: false;
+ property bool test2: false;
+ property bool test3: false;
+ property bool test4: false;
+ property bool test5: false;
+
+
+ property int a: 7
+ property int b: 8
+
+ Component.onCompleted: {
+ var b = 9;
+
+ test1 = (eval("a") == 7);
+ test2 = (eval("b") == 9);
+ try {
+ eval("c");
+ } catch(e) {
+ test3 = true;
+ }
+ test4 = (eval("console") == console);
+ test5 = (eval("Qt") == Qt);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exception.js b/tests/auto/declarative/qdeclarativeecmascript/data/exception.js
new file mode 100644
index 0000000000..160bbfa5b6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exception.js
@@ -0,0 +1 @@
+throw("Whoops!");
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml
new file mode 100644
index 0000000000..a2f0d1a8b7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property bool test: objectProperty.objectProperty.trueProperty
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml
new file mode 100644
index 0000000000..2102821aac
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ Component.onCompleted:
+ { throw(new Error("JS exception")) }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml
new file mode 100644
index 0000000000..c197ef8335
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ value: { throw(new Error("JS exception")) }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml
new file mode 100644
index 0000000000..9738d2cf24
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+QtObject {
+ property MyExtendedObject a;
+ a: MyExtendedObject { id: root }
+ property int b: Math.max(root.extendedProperty, 0)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
new file mode 100644
index 0000000000..b0e897efff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
@@ -0,0 +1,19 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyExtendedObject
+{
+ baseProperty: baseExtendedProperty
+ baseExtendedProperty: 13
+
+ coreProperty: extendedProperty
+ extendedProperty: 9
+
+ property QtObject nested: MyExtendedObject {
+ baseProperty: baseExtendedProperty
+ baseExtendedProperty: 13
+
+ coreProperty: extendedProperty
+ extendedProperty: 9
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml
new file mode 100644
index 0000000000..3c443cb975
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.0
+
+OverrideDefaultPropertyObject
+{
+ MyBaseExtendedObject {
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/function.qml b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
new file mode 100644
index 0000000000..6cd8751c93
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test1: false;
+ property bool test2: false;
+ property bool test3: false;
+
+ Component.onCompleted: {
+ var a = 10;
+
+ var func1 = new Function("a", "return a + 7");
+ var func2 = new Function("a", "return Qt.atob(a)");
+ var func3 = new Function("return a");
+
+ test1 = (func1(4) == 11);
+ test2 = (func2("Hello World!") == Qt.atob("Hello World!"));
+ try {
+ func3();
+ } catch(e) {
+ test3 = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml
new file mode 100644
index 0000000000..09540f1f6e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property variant a: function myFunction() { return 2; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
new file mode 100644
index 0000000000..c8c926aea8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
@@ -0,0 +1,73 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+import "functionAssignment.js" as Script
+
+MyQmlObject {
+ property variant a
+ property int aNumber: 10
+
+ property bool assignToProperty: false
+ property bool assignToPropertyFromJsFile: false
+
+ property bool assignWithThis: false
+ property bool assignWithThisFromJsFile: false
+
+ property bool assignToValueType: false
+
+ property bool assignFuncWithoutReturn: false
+ property bool assignWrongType: false
+ property bool assignWrongTypeToValueType: false
+
+
+ onAssignToPropertyChanged: {
+ function myFunction() {
+ return aNumber * 10;
+ }
+ a = myFunction;
+ }
+
+ property QtObject obj: QtObject {
+ property int aNumber: 4212
+ function myFunction() {
+ return this.aNumber * 10; // should use the aNumber from root, not this object
+ }
+ }
+ onAssignWithThisChanged: {
+ a = obj.myFunction;
+ }
+
+ onAssignToPropertyFromJsFileChanged: {
+ Script.bindPropertyWithThis()
+ }
+
+ onAssignWithThisFromJsFileChanged: {
+ Script.bindProperty()
+ }
+
+ property Text text: Text { }
+ onAssignToValueTypeChanged: {
+ text.font.pixelSize = (function() { return aNumber * 10; })
+ a = (function() { return text.font.pixelSize; })
+ }
+
+
+ // detecting errors:
+
+ onAssignFuncWithoutReturnChanged: {
+ function myFunction() {
+ }
+ a = myFunction;
+ }
+
+ onAssignWrongTypeChanged: {
+ function myFunction() {
+ return 'a string';
+ }
+ aNumber = myFunction;
+ }
+
+ onAssignWrongTypeToValueTypeChanged: {
+ text.font.pixelSize = (function() { return 'a string'; })
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js
new file mode 100644
index 0000000000..14daa7629f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js
@@ -0,0 +1,17 @@
+function bindProperty()
+{
+ a = (function(){ return aNumber * 10 })
+}
+
+
+function TestObject() { }
+TestObject.prototype.aNumber = 928349
+TestObject.prototype.bindFunction = function() {
+ return this.aNumber * 10 // this should not use the TestObject's aNumber
+}
+var testObj = new TestObject()
+
+function bindPropertyWithThis()
+{
+ a = testObj.bindFunction
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
new file mode 100644
index 0000000000..2ba02d1d76
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ function myFunction() {
+ a = 10;
+ }
+
+ Component.onCompleted: myFunction();
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
new file mode 100644
index 0000000000..6dcdefcbca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
@@ -0,0 +1,13 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ objectProperty: if(1) otherObject
+
+ property variant obj
+
+ obj: QtObject {
+ id: otherObject
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
new file mode 100644
index 0000000000..32b86110e4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
@@ -0,0 +1,12 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ objectProperty: otherObject
+
+ property variant obj
+
+ obj: QtObject {
+ id: otherObject
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/in.qml b/tests/auto/declarative/qdeclarativeecmascript/data/in.qml
new file mode 100644
index 0000000000..f9cccb5a5c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/in.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property bool test1: "x" in root
+ property bool test2: !("foo" in root)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include.js b/tests/auto/declarative/qdeclarativeecmascript/data/include.js
new file mode 100644
index 0000000000..232fd808f8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include.js
@@ -0,0 +1,8 @@
+var test1 = true
+var test2 = false
+var test3 = false
+
+function go() {
+ Qt.include("js/include2.js");
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
new file mode 100644
index 0000000000..61b0461833
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+import "include.js" as IncludeTest
+
+QtObject {
+ property int test0: 0
+ property bool test1: false
+ property bool test2: false
+ property bool test2_1: false
+ property bool test3: false
+ property bool test3_1: false
+
+ property int testValue: 99
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ test0 = IncludeTest.value
+ test1 = IncludeTest.test1
+ test2 = IncludeTest.test2
+ test2_1 = IncludeTest.test2_1
+ test3 = IncludeTest.test3
+ test3_1 = IncludeTest.test3_1
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js
new file mode 100644
index 0000000000..ea19eba300
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js
@@ -0,0 +1,11 @@
+function go() {
+ var a = Qt.include("missing.js", function(o) { test2 = o.status == o.NETWORK_ERROR });
+ test1 = a.status == a.NETWORK_ERROR
+
+ var b = Qt.include("blank.js", function(o) { test4 = o.status == o.OK });
+ test3 = b.status == b.OK
+
+ var c = Qt.include("exception.js", function(o) { test6 = o.status == o.EXCEPTION });
+ test5 = c.status == c.EXCEPTION
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
new file mode 100644
index 0000000000..1633ebaa25
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+import "include_callback.js" as IncludeTest
+
+QtObject {
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+ property bool test4: false
+ property bool test5: false
+ property bool test6: false
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml
new file mode 100644
index 0000000000..a648969426
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+import "include_pragma_outer.js" as Script
+
+Item {
+ property int test1
+
+ Component.onCompleted: {
+ test1 = Script.callFunction()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js
new file mode 100644
index 0000000000..a0380a25df
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js
@@ -0,0 +1,5 @@
+.pragma library
+
+function getValue() {
+ return 100;
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js
new file mode 100644
index 0000000000..d87bafc816
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js
@@ -0,0 +1,6 @@
+Qt.include("include_pragma_inner.js")
+
+function callFunction() {
+ return getValue();
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js
new file mode 100644
index 0000000000..e6a4676819
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js
@@ -0,0 +1,26 @@
+var myvar = 10;
+
+function go()
+{
+ var a = Qt.include("http://127.0.0.1:8111/remote_file.js",
+ function(o) {
+ test2 = o.status == o.OK
+ test3 = a.status == a.OK
+ test4 = myvar == 13
+
+ done = true;
+ });
+ test1 = a.status == a.LOADING
+
+
+ var b = Qt.include("http://127.0.0.1:8111/exception.js",
+ function(o) {
+ test7 = o.status == o.EXCEPTION
+ test8 = b.status == a.EXCEPTION
+ test9 = b.exception.toString() == "Whoops!";
+ test10 = o.exception.toString() == "Whoops!";
+
+ done2 = true;
+ });
+ test6 = b.status == b.LOADING
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
new file mode 100644
index 0000000000..0dfc74ff20
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+import "include_remote.js" as IncludeTest
+
+QtObject {
+ property bool done: false
+ property bool done2: false
+
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+ property bool test4: false
+ property bool test5: false
+
+ property bool test6: false
+ property bool test7: false
+ property bool test8: false
+ property bool test9: false
+ property bool test10: false
+
+ Component.onCompleted: IncludeTest.go();
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js
new file mode 100644
index 0000000000..cc90860cc9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js
@@ -0,0 +1,13 @@
+function go()
+{
+ var a = Qt.include("http://127.0.0.1:8111/missing.js",
+ function(o) {
+ test2 = o.status == o.NETWORK_ERROR
+ test3 = a.status == a.NETWORK_ERROR
+
+ done = true;
+ });
+
+ test1 = a.status == a.LOADING
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
new file mode 100644
index 0000000000..05a7399601
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+import "include_remote_missing.js" as IncludeTest
+
+QtObject {
+ property bool done: false
+
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+
+ Component.onCompleted: IncludeTest.go();
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js
new file mode 100644
index 0000000000..a49c07bbfc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js
@@ -0,0 +1,12 @@
+.pragma library
+
+var test1 = true
+var test2 = false
+var test3 = false
+
+var testValue = 99;
+
+function go() {
+ Qt.include("js/include2.js");
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
new file mode 100644
index 0000000000..e9f1c89bd8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+import "include_shared.js" as IncludeTest
+
+QtObject {
+ property int test0: 0
+ property bool test1: false
+ property bool test2: false
+ property bool test2_1: false
+ property bool test3: false
+ property bool test3_1: false
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ test0 = IncludeTest.value
+ test1 = IncludeTest.test1
+ test2 = IncludeTest.test2
+ test2_1 = IncludeTest.test2_1
+ test3 = IncludeTest.test3
+ test3_1 = IncludeTest.test3_1
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml
new file mode 100644
index 0000000000..6ab25f272a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml
@@ -0,0 +1,9 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+ Component.onCompleted: {
+ root.myinvokable(root);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml
new file mode 100644
index 0000000000..87b2d7e4a0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+ property bool test: false
+ Component.onCompleted: {
+ test = (root.returnme() == root)
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js b/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js
new file mode 100644
index 0000000000..2a0c039dfa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js
@@ -0,0 +1,4 @@
+test2 = true
+var test2_1 = true
+
+Qt.include("include3.js");
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js b/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js
new file mode 100644
index 0000000000..84b2770b6f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js
@@ -0,0 +1,3 @@
+test3 = true
+var test3_1 = true
+var value = testValue
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml
new file mode 100644
index 0000000000..e93007ab9a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+QtObject {
+ property int test
+
+ Component.onCompleted: {
+ var o = new Object;
+ o.test = 92;
+ test = o.test;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
new file mode 100644
index 0000000000..3ffdb339ad
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
@@ -0,0 +1,6 @@
+.pragma library
+
+function test(target)
+{
+ var a = target.a;
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
new file mode 100644
index 0000000000..c0789424de
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+import "libraryScriptAssert.js" as Test
+
+QtObject {
+ id: root
+ Component.onCompleted: Test.test(root);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
new file mode 100644
index 0000000000..7b940758ea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
@@ -0,0 +1,24 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+
+ objectListProperty: [
+ QtObject { property int a: 10 },
+ QtObject { property int a: 11 }
+ ]
+
+ function calcTest1() {
+ var rv = 0;
+ for (var ii = 0; ii < root.objectListProperty.length; ++ii) {
+ rv += root.objectListProperty[ii].a;
+ }
+ return rv;
+ }
+
+ property int test1: calcTest1();
+ property int test2: root.objectListProperty.length
+ property bool test3: root.objectListProperty[1] != undefined
+ property bool test4: root.objectListProperty[100] == undefined
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
new file mode 100644
index 0000000000..7940ab8c3d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test: children
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml
new file mode 100644
index 0000000000..77accd80de
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.1
+
+MyRevisionedClass
+{
+ prop1: prop2
+ onSignal1: method2()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml
new file mode 100644
index 0000000000..36057cb902
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml
@@ -0,0 +1,9 @@
+import Qt.test 1.1
+
+MyRevisionedSubclass
+{
+ prop1: prop3
+ onSignal1: method2()
+ prop3: prop4
+ onSignal3: method4()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml
new file mode 100644
index 0000000000..81769e98f7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+
+MyRevisionedSubclass
+{
+ prop1: prop3
+ onSignal1: method1()
+ onSignal3: method3()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml
new file mode 100644
index 0000000000..81ea536651
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml
@@ -0,0 +1,14 @@
+import Qt.test 1.1
+import QtQuick 1.0
+
+QtObject {
+ property variant a
+ property real test
+
+ a: MyRevisionedClass {
+ prop2: 11
+
+ Component.onCompleted: test = prop2
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml
new file mode 100644
index 0000000000..44d421e8ee
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRevisionedClass
+{
+ // Will not hit optimizer
+ property real p1: prop1 % 3
+ property real p2: prop2 % 3
+
+ // Should hit optimizer
+ property real p3: prop2
+
+ Component.onCompleted: method2()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml
new file mode 100644
index 0000000000..121642e0cf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRevisionedSubclass
+{
+ // Will not hit optimizer
+ property real p1: prop1 % 3
+ property real p2: prop2 % 3
+ property real p3: prop3 % 3
+ property real p4: prop4 % 3
+
+ // Should hit optimizer
+ property real p5: prop1
+ property real p6: prop2
+ property real p7: prop3
+ property real p8: prop4
+
+ Component.onCompleted: {
+ method1()
+ method2()
+ method3()
+ method4()
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml
new file mode 100644
index 0000000000..123650e4e8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml
@@ -0,0 +1,36 @@
+import QtQuick 1.0
+import Qt.test 1.1
+
+MyRevisionedSubclass
+{
+ // Will not hit optimizer
+ property real pA: propA % 3
+ property real pB: propB % 3
+ property real pC: propC % 3
+ property real pD: propD % 3
+ property real p1: prop1 % 3
+ property real p2: prop2 % 3
+ property real p3: prop3 % 3
+ property real p4: prop4 % 3
+
+ // Should hit optimizer
+ property real pE: propA
+ property real pF: propB
+ property real pG: propC
+ property real pH: propD
+ property real p5: prop1
+ property real p6: prop2
+ property real p7: prop3
+ property real p8: prop4
+
+ Component.onCompleted: {
+ methodA()
+ methodB()
+ methodC()
+ methodD()
+ method1()
+ method2()
+ method3()
+ method4()
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml
new file mode 100644
index 0000000000..0bbee16df8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ id: myObject
+ onBasicSignal: myObject.methodNoArgs()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml
new file mode 100644
index 0000000000..9f0c6b15fe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ id: myObject
+ onBasicSignal: myObject.method(163)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml
new file mode 100644
index 0000000000..1090b48f74
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ function testFunction() { return 19; }
+
+ property int test: testFunction()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml
new file mode 100644
index 0000000000..34c50d6647
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+MethodsObject {
+ function testFunction2() { return 17; }
+ function testFunction3() { return 16; }
+
+ property int test: testFunction()
+ property int test2: testFunction2()
+ property int test3: testFunction3()
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml
new file mode 100644
index 0000000000..bebdf3d883
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ property alias blah: item.x
+ Item { id: item }
+
+ function testFunction() { return 9; }
+ property int test: testFunction();
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml
new file mode 100644
index 0000000000..d9c63e67bd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property string test: thing.stringProperty
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml
new file mode 100644
index 0000000000..9e0bcf09bb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ Item {}
+
+ SpuriousWarning {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml
new file mode 100644
index 0000000000..7e7da8d7a8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property int childrenCount: root.children.length
+
+ Item {}
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml
new file mode 100644
index 0000000000..f9585db009
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ stringProperty: MyQmlContainer.prop
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml
new file mode 100644
index 0000000000..e86cc961af
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml
@@ -0,0 +1,19 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+
+ property bool readOk: false;
+ property bool writeOk: false
+
+ Component.onCompleted: {
+ readOk = (root.nonscriptable == undefined);
+
+ try {
+ root.nonscriptable = 10
+ } catch (e) {
+ writeOk = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
new file mode 100644
index 0000000000..cbd2d3e7e8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property QtObject test
+ test: if (1) model
+ property ListModel model
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml b/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml
new file mode 100644
index 0000000000..30a77e8aed
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml
@@ -0,0 +1,18 @@
+import Qt.test 1.0
+
+NumberAssignment {
+ test1: if (1) 6.7
+ test2: if (1) "6.7"
+ test3: if (1) 6
+ test4: if (1) "6"
+
+ test5: if (1) 6.7
+ test6: if (1) "6.7"
+ test7: if (1) 6
+ test8: if (1) "6"
+
+ test9: if (1) 6.7
+ test10: if (1) "6.7"
+ test11: if (1) 6
+ test12: if (1) "6"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml
new file mode 100644
index 0000000000..ca8c90d818
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ objectName: "hello"
+
+ property string test1: objectName
+ property string test2: objectName.substr(1, 3)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
new file mode 100644
index 0000000000..ef0e304ac1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property variant item: child
+ Item { id: child }
+
+ property bool test1: child == child
+ property bool test2: child.parent == root
+ property bool test3: root != child
+ property bool test4: item == child
+ property bool test5: item != root
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml
new file mode 100644
index 0000000000..090c948f26
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ id: obj
+ property alias c1: myConstants.c1
+ property alias c2: myConstants.c2
+ property int c3: 0
+
+ objectProperty: ConstantsOverrideBindings {
+ id: myConstants
+ c2: obj.c3
+ }
+
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
new file mode 100644
index 0000000000..53427b76e5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ Component.onCompleted: { var a = getObject(); a = null; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
new file mode 100644
index 0000000000..a778dcc8b6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property int a
+ property variant b
+
+ Component.onCompleted: {
+ try {
+ root.a = undefined;
+ } catch(e) {
+ console.log (e.fileName + ":" + e.lineNumber + ":" + e);
+ }
+
+ try {
+ root.a = "Hello";
+ } catch(e) {
+ console.log (e.fileName + ":" + e.lineNumber + ":" + e);
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml b/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml
new file mode 100644
index 0000000000..7deb84a1be
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyDerivedObject {
+ property bool test: false
+
+ Component.onCompleted: {
+ test = intProperty()
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
new file mode 100644
index 0000000000..2e9e1736cb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property int test: getObjects().length
+ property bool test2: getObjects()[0].trueProperty
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
new file mode 100644
index 0000000000..02357d45f4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+
+QtObject {
+ property string test: "aaaa"
+ + "bbbb"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc";
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js
new file mode 100644
index 0000000000..092bc2b041
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js
@@ -0,0 +1 @@
+;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
new file mode 100644
index 0000000000..b7bb366698
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+import "qtbug_11600.js" as Test
+
+QtObject {
+ id: goo
+
+ property bool test: undefined == goo.Test.foo
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
new file mode 100644
index 0000000000..05c482cae7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test: false
+ Component.onCompleted: {
+ try {
+ console.log(sorryNoSuchProperty);
+ } catch (e) {
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml
new file mode 100644
index 0000000000..9ac44308c6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ onBasicSignal: print("Hello world!");
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
new file mode 100644
index 0000000000..e531efcd5a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+ property QtObject object: QtObject {
+ id: nested
+ property QtObject nestedObject
+ }
+
+ Component.onCompleted: {
+ nested.nestedObject = root;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml b/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml
new file mode 100644
index 0000000000..0dc404b5db
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "obj"
+ regExp: /[a-zA-z]/
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js b/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js
new file mode 100644
index 0000000000..1b123aee61
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js
@@ -0,0 +1,2 @@
+myvar = 13;
+test5 = true;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml
new file mode 100644
index 0000000000..9555b7f95b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml
@@ -0,0 +1,40 @@
+import QtQuick 1.0
+
+Item {
+ property int a: 0
+ property int b: 14
+
+ function b() { return 11; }
+ function c() { return 33; }
+
+ QtObject {
+ id: a
+ property int value: 19
+ }
+
+ QtObject {
+ id: c
+ property int value: 24
+ }
+
+ QtObject {
+ id: nested
+ property int a: 1
+ property int test: a.value
+ property int test2: b
+ property int test3: c.value
+ }
+
+
+ // id takes precedence over local, and root properties
+ property int test1: a.value
+ property alias test2: nested.test
+
+ // properties takes precedence over local, and root methods
+ property int test3: b
+ property alias test4: nested.test2
+
+ // id takes precedence over methods
+ property int test5: c.value
+ property alias test6: nested.test3
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
new file mode 100644
index 0000000000..0b0770e6b9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ id: root
+
+ property int foo: 12
+
+ property bool test1: foo == 12
+ property bool test2: console != 11
+ property bool test3: root.console == 11
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml
new file mode 100644
index 0000000000..d65b6e7c7c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml
@@ -0,0 +1,12 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ id: a
+ property int b: 9
+
+ property int test
+ property string test2
+
+ // Should resolve to signal arguments, not to other elements in the file
+ onArgumentSignal: { test = a; test2 = b; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml
new file mode 100644
index 0000000000..63dba2fc9f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml
@@ -0,0 +1,44 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property int a: 1
+ property int binding: a
+ property string binding2: a + "Test"
+ property int binding3: myFunction()
+ property int binding4: nestedObject.myNestedFunction()
+
+ function myFunction() {
+ return a;
+ }
+
+ Item {
+ id: nestedObject
+
+ function myNestedFunction() {
+ return a;
+ }
+
+ property int a: 2
+ property int binding: a
+ property string binding2: a + "Test"
+ property int binding3: myFunction()
+ property int binding4: myNestedFunction()
+ }
+
+ ScopeObject {
+ id: compObject
+ }
+
+ property alias test1: root.binding
+ property alias test2: nestedObject.binding
+ property alias test3: root.binding2
+ property alias test4: nestedObject.binding2
+ property alias test5: root.binding3
+ 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/qdeclarativeecmascript/data/scriptConnect.1.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js
new file mode 100644
index 0000000000..54284fea47
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js
@@ -0,0 +1,4 @@
+function testFunction() {
+ test = true;
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml
new file mode 100644
index 0000000000..65697d9382
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptConnect.1.js" as Script
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(Script.testFunction);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js
new file mode 100644
index 0000000000..595c778aa7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js
@@ -0,0 +1,5 @@
+function testFunction() {
+ if (this.b == 12)
+ test = true;
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml
new file mode 100644
index 0000000000..86ff7987d8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml
@@ -0,0 +1,16 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptConnect.2.js" as Script
+
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ Component.onCompleted: {
+ var a = new Object;
+ a.b = 12;
+ root.argumentSignal.connect(a, Script.testFunction);
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml
new file mode 100644
index 0000000000..db2f00578c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ function testFunction() {
+ test = true;
+ }
+
+ Component.onCompleted: root.argumentSignal.connect(testFunction);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml
new file mode 100644
index 0000000000..a2d90ff819
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml
@@ -0,0 +1,12 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(methodNoArgs);
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml
new file mode 100644
index 0000000000..21fac15d69
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(root, methodNoArgs);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js
new file mode 100644
index 0000000000..71bdd088a2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js
@@ -0,0 +1,3 @@
+function testFunction() {
+ test++;
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml
new file mode 100644
index 0000000000..4053091988
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptConnect.6.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: {
+ root.argumentSignal.connect(Script.testFunction);
+ root.argumentSignal.connect(Script.testFunction);
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js
new file mode 100644
index 0000000000..407426fcd1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js
@@ -0,0 +1,6 @@
+function testFunction() {
+ test++;
+}
+
+function otherFunction() {
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml
new file mode 100644
index 0000000000..bbe70249ba
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml
@@ -0,0 +1,13 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptDisconnect.1.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(Script.testFunction);
+
+ onBasicSignal: root.argumentSignal.disconnect(Script.testFunction);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml
new file mode 100644
index 0000000000..8a166f41ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml
@@ -0,0 +1,14 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptDisconnect.1.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(root, Script.testFunction);
+
+ onBasicSignal: root.argumentSignal.disconnect(root, Script.testFunction);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml
new file mode 100644
index 0000000000..548f2a12f7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml
@@ -0,0 +1,14 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptDisconnect.1.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(root, Script.testFunction);
+
+ onBasicSignal: root.argumentSignal.disconnect(Script.testFunction);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml
new file mode 100644
index 0000000000..11b22d7216
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml
@@ -0,0 +1,13 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptDisconnect.1.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(Script.testFunction);
+
+ onBasicSignal: root.argumentSignal.disconnect(Script.otherFunction);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js
new file mode 100644
index 0000000000..d22f623edb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js
@@ -0,0 +1,4 @@
+// Comment
+a = 10
+
+function getValue() { a = 10; return 0; }
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml
new file mode 100644
index 0000000000..f601f497ee
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+import "scriptErrors.js" as Script
+
+MyQmlObject {
+ property int t: a.value
+ property int w: Script.getValue();
+ property int x: undefined
+ property int y: (a.value, undefinedObject)
+
+ onBasicSignal: { console.log(a.value); }
+ id: myObj
+ onAnotherBasicSignal: myObj.trueProperty = false;
+ onThirdBasicSignal: myObj.fakeProperty = "";
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml
new file mode 100644
index 0000000000..58cf8051f0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml
@@ -0,0 +1,17 @@
+import Qt.test 1.0
+
+MyQmlContainer {
+ property bool triggerDelete: false
+
+ children: [
+ MyQmlObject {
+ // Will trigger deletion on binding assignment
+ deleteOnSet: Math.max(0, 1)
+ },
+
+ MyQmlObject {
+ // Will trigger deletion on binding assignment, but after component creation
+ deleteOnSet: if (triggerDelete) 1; else 0;
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml
new file mode 100644
index 0000000000..074851a67b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml
@@ -0,0 +1,18 @@
+import Qt.test 1.0
+
+MyQmlContainer {
+ property bool triggerDelete: false
+
+ children: [
+ MyQmlObject {
+ // Will trigger deletion during binding evaluation
+ stringProperty: {deleteMe(), "Hello"}
+ },
+
+ MyQmlObject {
+ // Will trigger deletion during binding evaluation, but after component creation
+ stringProperty: if (triggerDelete) { deleteMe(), "Hello" } else { "World" }
+ }
+
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml
new file mode 100644
index 0000000000..2d090b8f0d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml
@@ -0,0 +1,16 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+ property bool test1: false
+ property bool test2: false
+
+ MyQmlObject.value2: 7
+
+ Component.onCompleted: {
+ test1 = root.MyQmlObject.value2 == 7;
+ test2 = root.MyQmlObjectAlias.value2 == 7;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml
new file mode 100644
index 0000000000..7a6aba74be
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+Item {
+ property int test: myObject.object.a
+
+ Item {
+ id: myObject
+ property QtObject object;
+ object: QtObject {
+ property int a: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml
new file mode 100644
index 0000000000..fbd09142f7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ onBasicSignal: setString('pass')
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml
new file mode 100644
index 0000000000..6467c42bb9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c + ' ' + d + ' ' + e)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml
new file mode 100644
index 0000000000..4fc2dab943
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml
@@ -0,0 +1,18 @@
+import Qt.test 1.0
+
+MyQmlObject
+{
+ id: root
+ property int intProperty
+ property real realProperty
+ property color colorProperty
+ property variant variantProperty
+ property int enumProperty
+ property int qtEnumProperty
+
+ signal mySignal(int a, real b, color c, variant d, int e, int f)
+
+ onMySignal: { intProperty = a; realProperty = b; colorProperty = c; variantProperty = d; enumProperty = e; qtEnumProperty = f; }
+
+ onBasicSignal: root.mySignal(10, 19.2, Qt.rgba(1, 1, 0, 1), Qt.rgba(1, 0, 1, 1), MyQmlObject.EnumValue3, Qt.LeftButton)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml
new file mode 100644
index 0000000000..8410d33319
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property real base: 50
+ property alias test1: myObject.test1
+ property alias test2: myObject.test2
+
+ objectProperty: QtObject {
+ id: myObject
+ property real test1: base
+ property real test2: Math.max(0, base)
+ }
+
+ // Signal with no args
+ onBasicSignal: base = 200
+ // Signal with args
+ onArgumentSignal: base = 400
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml
new file mode 100644
index 0000000000..49293edfb3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ onSignalWithUnknownType: variantMethod(arg);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml b/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml
new file mode 100644
index 0000000000..2932c77826
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test1: (a === true)
+ property bool test2: !(a === false)
+ property bool test3: (b === 11.2)
+ property bool test4: !(b === 9)
+ property bool test5: (c === 9)
+ property bool test6: !(c === 13)
+ property bool test7: (d === "Hello world")
+ property bool test8: !(d === "Hi")
+
+ property bool a: true
+ property real b: 11.2
+ property int c: 9
+ property string d: "Hello world"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
new file mode 100644
index 0000000000..1e5afdf54a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property variant a: 10
+ property int x: 10
+ property int test: a.x
+
+ Component.onCompleted: {
+ a = 11;
+ a = root;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
new file mode 100644
index 0000000000..60d39fa171
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant obj: nested
+
+ property variant obj2
+ obj2: NestedTypeTransientErrors {
+ id: nested
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml
new file mode 100644
index 0000000000..e73d38e2ce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ resettableProperty: 19
+
+ function doReset() {
+ resettableProperty = undefined;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml b/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml
new file mode 100644
index 0000000000..eceff60aa1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property bool setUndefined: false
+
+ resettableProperty: setUndefined?undefined:92
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml b/tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml
new file mode 100644
index 0000000000..33b4a68c40
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyTypeObject {
+ rectProperty: Qt.rect(0,0,100,100)
+ rectFProperty: Qt.rect(0,0.5,100,99.5)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
new file mode 100644
index 0000000000..849dfadd4f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool runTest: false
+ onRunTestChanged: test1 = undefined
+
+ property variant test1: 10
+ property variant test2: (runTest == false)?11:undefined
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml b/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
new file mode 100644
index 0000000000..31bf69d33f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+QtObject {
+ function writeValue2() { MyQmlObject.value2 = 9 }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml
new file mode 100644
index 0000000000..035f0374e8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml
@@ -0,0 +1,46 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property bool test: false
+
+ property real data: 9
+ property real binding: data
+
+ property alias aliasProperty: root.aliasBinding
+ property real aliasBinding: data
+
+ Component.onCompleted: {
+ // Non-aliased properties
+ if (binding != 9) return;
+
+ data = 11;
+ if (binding != 11) return;
+
+ binding = 6;
+ if (binding != 6) return;
+
+ data = 3;
+ if (binding != 6) return;
+
+
+ // Writing through an aliased property
+ if (aliasProperty != 3) return;
+ if (aliasBinding != 3) return;
+
+ data = 4;
+ if (aliasProperty != 4) return;
+ if (aliasBinding != 4) return;
+
+ aliasProperty = 19;
+ if (aliasProperty != 19) return;
+ if (aliasBinding != 19) return;
+
+ data = 5;
+ if (aliasProperty != 19) return;
+ if (aliasBinding != 19) return;
+
+ test = true;
+ }
+}