Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativeecmascript / data / function.qml
1 import QtQuick 1.0
2
3 QtObject {
4     property bool test1: false;
5     property bool test2: false;
6     property bool test3: false;
7
8     Component.onCompleted: {
9         var a = 10;
10
11         var func1 = new Function("a", "return a + 7");
12         var func2 = new Function("a", "return Qt.atob(a)");
13         var func3 = new Function("return a");
14
15         test1 = (func1(4) == 11);
16         test2 = (func2("Hello World!") == Qt.atob("Hello World!"));
17         try {
18             func3();
19         } catch(e) {
20             test3 = true;
21         }
22     }
23 }