aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-09-01 11:48:15 +0200
committerLars Knoll <lars.knoll@qt.io>2017-09-02 07:12:17 +0000
commit74c8fe86755af485f8d0a47799d6d50f00070f05 (patch)
tree9e3d8c51d46d9f0fa2555cc77d184d6b3ee1be7d /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parenta91383545c6f487cff61f401d11f1e85939222e9 (diff)
Always set the correct FunctionObject when calling JS functions
Renamed ScopedCallData to JSCall, enforced passing a JS FunctionObject to it, and added call() and callAsConstructor() methods to it. Change-Id: I30db65c9765c2896b5909fe2105c0934c6dad861 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index f36e260642..5f6b0a056e 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -2347,10 +2347,10 @@ static inline bool evaluate_error(QV8Engine *engine, const QV4::Value &o, const
scope.engine->catchException();
return true;
}
- QV4::ScopedCallData d(scope, 1);
- d->args[0] = o;
- d->thisObject = engine->global();
- function->call(d);
+ QV4::JSCall jsCall(scope, function, 1);
+ jsCall->args[0] = o;
+ jsCall->thisObject = engine->global();
+ jsCall.call();
if (scope.engine->hasException) {
scope.engine->catchException();
return true;
@@ -2377,10 +2377,10 @@ static inline bool evaluate_value(QV8Engine *engine, const QV4::Value &o,
return false;
QV4::ScopedValue value(scope);
- QV4::ScopedCallData d(scope, 1);
- d->args[0] = o;
- d->thisObject = engine->global();
- value = function->call(d);
+ QV4::JSCall jsCall(scope, function, 1);
+ jsCall->args[0] = o;
+ jsCall->thisObject = engine->global();
+ value = jsCall.call();
if (scope.engine->hasException) {
scope.engine->catchException();
return false;
@@ -2406,10 +2406,10 @@ static inline QV4::ReturnedValue evaluate(QV8Engine *engine, const QV4::Value &o
}
if (!function)
return QV4::Encode::undefined();
- QV4::ScopedCallData d(scope, 1);
- d->args[0] = o;
- d->thisObject = engine->global();
- QV4::ScopedValue result(scope, function->call(d));
+ QV4::JSCall jsCall(scope, function, 1);
+ jsCall->args[0] = o;
+ jsCall->thisObject = engine->global();
+ QV4::ScopedValue result(scope, jsCall.call());
if (scope.engine->hasException) {
scope.engine->catchException();
return QV4::Encode::undefined();