tests/auto/declarative/qdeclarativeecmascript/data/function.qml
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 15:10:48 +0300
changeset 30 5dc02b23752f
child 33 3e2da88830cd
permissions -rw-r--r--
Revision: 201025 Kit: 2010127

import Qt 4.7

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!"));
        test3 = (func3() == undefined);
    }
}