diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 1c42d9d425..02f79d2dd7 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -196,6 +196,7 @@ private slots: void functionAssignmentfromJS_invalid(); void eval(); void function(); + void functionException(); void qtbug_10696(); void qtbug_11606(); void qtbug_11600(); @@ -5071,6 +5072,19 @@ void tst_qdeclarativeecmascript::function() delete o; } +void tst_qdeclarativeecmascript::functionException() +{ + // QTBUG-24037 - shouldn't crash. + QString errstr = testFileUrl("v8functionException.qml").toString() + QLatin1String(":13: SyntaxError: Unexpected token ILLEGAL"); + QTest::ignoreMessage(QtWarningMsg, qPrintable(errstr)); + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Exception occurred during compilation of function: dynamicSlot()"); + QDeclarativeComponent component(&engine, testFileUrl("v8functionException.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + QMetaObject::invokeMethod(o, "dynamicSlot"); + delete o; +} + // Test the "Qt.include" method void tst_qdeclarativeecmascript::include() { |