summaryrefslogtreecommitdiff
path: root/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
diff options
context:
space:
mode:
authorAlexandra Cherdantseva <neluhus.vagus@gmail.com>2019-02-18 14:57:27 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2019-04-17 15:46:36 +0000
commit484e9de6d86d011bd349890cba87a25554b0f672 (patch)
treefbae02a39db4aa73557d9c70ffd120d678c508bb /tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
parentba51b7a53420a5de576f6d07b2f4feab5ea4d21a (diff)
downloadqtscript-484e9de6d86d011bd349890cba87a25554b0f672.tar.gz
Fix thisObject() of QScriptable argument for String(), etc
When `String(object)` is evaluated, and `object` is a QObject or some custom object with native prototype, then `object.toString()` will be called with incorrect `this`. This also applies for Number(), Boolean() and other built-in constructors. Change-Id: I0219f0e119c1e29d80e4c0f856421352715e9e6e Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp')
-rw-r--r--tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
index e199d71..58fee07 100644
--- a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
+++ b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
@@ -1354,7 +1354,7 @@ void tst_QScriptExtQObject::callQtInvokable2()
// first time we expect failure because the metatype is not registered
m_myObject->resetQtFunctionInvoked();
- QCOMPARE(QMetaType::type("QVector<CustomType>"), QMetaType::UnknownType); // this type should not be registered yet
+ QCOMPARE(QMetaType::Type(QMetaType::type("QVector<CustomType>")), QMetaType::UnknownType); // this type should not be registered yet
QCOMPARE(m_engine->evaluate("myObject.myInvokableReturningVectorOfCustomType()").isError(), true);
QCOMPARE(m_myObject->qtFunctionInvoked(), -1);