From 3a45458b96bdcbccc189aabf668e998ea03be46f Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 28 Sep 2016 00:09:05 +0200 Subject: Fix crash on Array.prototype.join.call(0) We (incorrectly) didn't check the return value to make sure we had a valid self. At the same time, rename the self variable to match up with other methods. Task-number: QTBUG-53672 Change-Id: Ia0ae5a553e49c4c3b2834c7fdf649fe6373951a2 Reviewed-by: Simon Hausmann --- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/auto/qml/qjsengine/tst_qjsengine.cpp') diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 8594aec8cd..acaa6604f9 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -143,6 +143,7 @@ private slots: void arrayPop_QTBUG_35979(); void array_unshift_QTBUG_52065(); + void array_join_QTBUG_53672(); void regexpLastMatch(); void indexedAccesses(); @@ -3016,6 +3017,14 @@ void tst_QJSEngine::array_unshift_QTBUG_52065() QCOMPARE(result.property(i).toInt(), i); } +void tst_QJSEngine::array_join_QTBUG_53672() +{ + QJSEngine eng; + QJSValue result = eng.evaluate("Array.prototype.join.call(0)"); + QVERIFY(result.isString()); + QCOMPARE(result.toString(), QString("")); +} + void tst_QJSEngine::regexpLastMatch() { QJSEngine eng; -- cgit v1.2.3