aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-08-06 11:05:43 +0200
committerErik Verbruggen <erik.verbruggen@digia.com>2014-08-08 10:45:28 +0200
commitead3da17e7a91a5e6adf7b03e651950378d1326c (patch)
tree12ba9236a822d817eae408a4d5231a91df8f3664 /tests
parent068e3609945496ede8ce3aa6cc21a41c2df0b41c (diff)
V4: change string flattening to be iterative and use a worklist.
And not recursive, because that might blow out of stack space. Task-number: QTBUG-39520 Change-Id: Id961d4af03a543d3efa173f976626cf2dae4f483 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 6b37163b40..c68f1190dd 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -325,6 +325,7 @@ private slots:
void importedScriptsAccessOnObjectWithInvalidContext();
void contextObjectOnLazyBindings();
void garbageCollectionDuringCreation();
+ void qtbug_39520();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -7665,6 +7666,30 @@ void tst_qqmlecmascript::garbageCollectionDuringCreation()
QCOMPARE(container->dataChildren.count(), 0);
}
+void tst_qqmlecmascript::qtbug_39520()
+{
+ QQmlComponent component(&engine);
+ component.setData("import QtQuick 2.0\n"
+ "Item {\n"
+ " property string s\n"
+ " Component.onCompleted: test()\n"
+ " function test() {\n"
+ " var count = 1 * 1000 * 1000\n"
+ " var t = ''\n"
+ " for (var i = 0; i < count; ++i)\n"
+ " t += 'testtest ' + i + '\n'\n"
+ " s = t\n"
+ " }\n"
+ "}\n",
+ QUrl());
+
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(!object.isNull());
+
+ QString s = object->property("s").toString();
+ QCOMPARE(s.count('\n'), 1 * 1000 * 1000);
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"