aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-02-02 14:51:17 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-09 07:32:07 +0100
commita4b4932efb631a3c467c9bb4b3e4f99ca70a066d (patch)
treeda3f6180bab6a392c1b56e01fc62802349b4e037 /tests/auto/declarative/qdeclarativeecmascript/data
parent298b86b95bd42d12e15e8d8a137cd9bee21d6094 (diff)
Check dynamic slot function for nullness before evaluation
Previously, we didn't check whether the function object handle associated with a dynamic slot's method index was null before attempting to evaluate it, which could cause a crash in some circumstances. This change also adds better error reporting during function compilation. Task-number: QTBUG-24064 Task-number: QTBUG-24037 Task-number: QTBUG-23387 Change-Id: I3c5e35e8c16187870125736013a5935fcc5cb1f2 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/v8functionException.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/v8functionException.qml b/tests/auto/declarative/qdeclarativeecmascript/data/v8functionException.qml
new file mode 100644
index 0000000000..51df1c65d8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/v8functionException.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+
+// This test uses a multi-line string which has \r-terminated
+// string fragments. The expression rewriter deliberately doesn't
+// handle \r-terminated string fragments (see QTBUG-24064) and thus
+// this test ensures that we don't crash when the client attempts
+// to invoke a non-compiled dynamic slot.
+
+Item {
+ id: root
+
+ function dynamicSlot() {
+ var someString = "Hello, this is a multiline string";
+ }
+}