aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-21 01:01:17 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-03-21 10:59:45 +0100
commit7a349710cc7bd63b52bb70e4d61a6489e083ceb2 (patch)
tree5b90a7fc6fb53d79ce16973ac8d316b746994a10 /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parent40e149f5fa67967e890b8f9d09cbb00cb2f62259 (diff)
parent937d8114e9ccf607462ab72a4b6e801756698473 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qv4bytecodehandler.cpp src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4compileddata_p.h src/qml/compiler/qv4compiler.cpp src/qml/compiler/qv4instr_moth.cpp src/qml/compiler/qv4instr_moth_p.h src/qml/jit/qv4baselinejit.cpp src/qml/jit/qv4baselinejit_p.h src/qml/jsruntime/qv4function.cpp src/qml/jsruntime/qv4vme_moth.cpp Change-Id: I8fb4d6f19677bcec0a4593b250f2eda5ae85e3d2
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index e6603a1a19..3cd70a0d1b 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -365,6 +365,7 @@ private slots:
void numberToStringWithRadix();
void tailCallWithArguments();
void deleteSparseInIteration();
+ void saveAccumulatorBeforeToInt32();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -1608,7 +1609,7 @@ void tst_qqmlecmascript::aliasPropertyReset()
// test that a manual write (of undefined) to a non-resettable property fails properly
QUrl url = testFileUrl("aliasreset/aliasPropertyReset.error.1.qml");
- QString warning1 = url.toString() + QLatin1String(": Error: Cannot assign [undefined] to int");
+ QString warning1 = url.toString() + QLatin1String(":15: Error: Cannot assign [undefined] to int");
QQmlComponent e1(&engine, url);
object = e1.create();
QVERIFY(object != nullptr);
@@ -6474,7 +6475,8 @@ void tst_qqmlecmascript::signalHandlers()
QMetaObject::invokeMethod(o.data(), "testSignalHandlerCall");
QCOMPARE(o->property("count").toInt(), 1);
- QCOMPARE(o->property("errorString").toString(), QLatin1String("TypeError: Property 'onTestSignal' of object [object Object] is not a function"));
+ QString scopeObjectAsString = o->property("scopeObjectAsString").toString();
+ QCOMPARE(o->property("errorString").toString(), QString("TypeError: Property 'onTestSignal' of object %1 is not a function").arg(scopeObjectAsString));
QCOMPARE(o->property("funcCount").toInt(), 0);
QMetaObject::invokeMethod(o.data(), "testSignalConnection");
@@ -8169,12 +8171,11 @@ void tst_qqmlecmascript::stackLimits()
void tst_qqmlecmascript::idsAsLValues()
{
QQmlEngine engine;
- QString err = QString(QLatin1String("%1:5 left-hand side of assignment operator is not an lvalue\n")).arg(testFileUrl("idAsLValue.qml").toString());
+ QString err = QString(QLatin1String("%1:5: Error: left-hand side of assignment operator is not an lvalue")).arg(testFileUrl("idAsLValue.qml").toString());
QQmlComponent component(&engine, testFileUrl("idAsLValue.qml"));
- QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(err));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
QVERIFY(!object);
- QCOMPARE(component.errorString(), err);
}
void tst_qqmlecmascript::qtbug_34792()
@@ -8936,6 +8937,17 @@ void tst_qqmlecmascript::deleteSparseInIteration()
QCOMPARE(value.property("2").toInt(), 4096);
}
+void tst_qqmlecmascript::saveAccumulatorBeforeToInt32()
+{
+ QJSEngine engine;
+
+ // Infinite recursion produces a range error, but should not crash.
+ // Also, any GC runs in between should not trash the temporary results of "a+a".
+ const QJSValue value = engine.evaluate("function a(){a(a&a+a)}a()");
+ QVERIFY(value.isError());
+ QCOMPARE(value.toString(), QLatin1String("RangeError: Maximum call stack size exceeded."));
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"