Use V4 binding for non-final properties where possible
[profile/ivi/qtdeclarative.git] / tests / auto / qml / qqmlecmascript / data / propertyAssignmentErrors.qml
1 import QtQuick 2.0
2
3 QtObject {
4     id: root
5
6     property int a
7     property variant b
8
9     property bool test1: false;
10     property bool test2: false;
11
12     Component.onCompleted: {
13         try {
14             root.a = undefined;
15         } catch(e) {
16             if (e.message == "Cannot assign [undefined] to int" &&
17                 e.stack.indexOf("propertyAssignmentErrors.qml:14") != -1)
18                 root.test1 = true;
19         }
20
21         try {
22             root.a = "Hello";
23         } catch(e) {
24             if (e.message == "Cannot assign QString to int" &&
25                 e.stack.indexOf("propertyAssignmentErrors.qml:22") != -1)
26                 root.test2 = true;
27         }
28     }
29 }