summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-30 07:27:47 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-30 07:27:47 (GMT)
commitb742568492c56aee9445a1fbf3e90e9ef3cb5823 (patch)
tree765bfde02d759536e9a1f7cfe95772c89a8b3c3b /tests/auto/declarative/qdeclarativeecmascript/data/function.qml
parent89f21d7269ae7bf29e718958d00da84e5c60257f (diff)
downloadQt-b742568492c56aee9445a1fbf3e90e9ef3cb5823.zip
Qt-b742568492c56aee9445a1fbf3e90e9ef3cb5823.tar.gz
Qt-b742568492c56aee9445a1fbf3e90e9ef3cb5823.tar.bz2
Ensure eval and Function are in the correct scope
QTBUG-10236
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data/function.qml')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/function.qml19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/function.qml b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
new file mode 100644
index 0000000..b435f58
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
@@ -0,0 +1,19 @@
+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);
+ }
+}