Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativexmlhttprequest / data / callbackException.qml
1 import QtQuick 1.0
2
3 QtObject {
4     id: obj
5     property string url
6     property string which
7     property bool threw: false
8
9     onWhichChanged: {
10         var x = new XMLHttpRequest;
11
12         x.onreadystatechange = function() {
13             if (x.readyState == which) {
14                 obj.threw = true
15                 throw(new Error("Exception from Callback"))
16             }
17         }
18
19         x.open("GET", url);
20         x.setRequestHeader("Test-header", "TestValue");
21         x.send();
22     }
23 }
24
25