aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-04-29 09:55:49 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-05-01 09:08:52 +0000
commit1650377af7dfb01a0641d4e21bf1ba33e6a7320f (patch)
tree3a4d704484b49905149d0f26d0937af6e14e39e9 /tests/auto/qml/qqmlecmascript/data
parent3b0cb49ef0cff2e7ae4ba295d035b87f09fdea4f (diff)
Fix crash when trying to call a property of the scope or context object
For calls on properties of the scope or context object the thisObject parameter in the callData is a reference to the QmlContext, not a real object - therefore the toString conversion fails. Task-number: QTBUG-52340 Change-Id: I08d01cc5c05920c2fac46ddd40fa41e630bcade3 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/qtbug_52340.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug_52340.qml b/tests/auto/qml/qqmlecmascript/data/qtbug_52340.qml
new file mode 100644
index 0000000000..03f90c15c8
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/qtbug_52340.qml
@@ -0,0 +1,13 @@
+import QtQml 2.0
+
+QtObject {
+ property bool someProperty: true
+ function testCall() {
+ try {
+ someProperty(); // should throw
+ return false
+ } catch (e) {
+ return true
+ }
+ }
+}