diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-04-29 09:55:49 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-01 09:08:52 +0000 |
commit | 1650377af7dfb01a0641d4e21bf1ba33e6a7320f (patch) | |
tree | 3a4d704484b49905149d0f26d0937af6e14e39e9 /src | |
parent | 3b0cb49ef0cff2e7ae4ba295d035b87f09fdea4f (diff) |
Fix crash when trying to call a property of the scope or context object
For calls on properties of the scope or context object the thisObject parameter
in the callData is a reference to the QmlContext, not a real object - therefore
the toString conversion fails.
Task-number: QTBUG-52340
Change-Id: I08d01cc5c05920c2fac46ddd40fa41e630bcade3
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index a988313f5f..d8ae7d4e92 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -953,10 +953,9 @@ ReturnedValue Runtime::callQmlScopeObjectProperty(ExecutionEngine *engine, int p Scope scope(engine); ScopedFunctionObject o(scope, getQmlScopeObjectProperty(engine, callData->thisObject, propertyIndex)); if (!o) { - QString error = QStringLiteral("Property '%1' of object %2 is not a function").arg(propertyIndex).arg(callData->thisObject.toQStringNoThrow()); + QString error = QStringLiteral("Property '%1' of scope object is not a function").arg(propertyIndex); return engine->throwTypeError(error); } - return o->call(callData); } @@ -965,7 +964,7 @@ ReturnedValue Runtime::callQmlContextObjectProperty(ExecutionEngine *engine, int Scope scope(engine); ScopedFunctionObject o(scope, getQmlContextObjectProperty(engine, callData->thisObject, propertyIndex)); if (!o) { - QString error = QStringLiteral("Property '%1' of object %2 is not a function").arg(propertyIndex).arg(callData->thisObject.toQStringNoThrow()); + QString error = QStringLiteral("Property '%1' of context object is not a function").arg(propertyIndex); return engine->throwTypeError(error); } |