From 74c8fe86755af485f8d0a47799d6d50f00070f05 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 1 Sep 2017 11:48:15 +0200 Subject: 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 --- .../auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests') 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(); -- cgit v1.2.3