diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-03 20:26:28 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-04 07:08:19 +0000 |
commit | c0f961cd6b82a523e277f6d8778a20508b15697d (patch) | |
tree | 7e4986686630404123a9f40eeb4881a089072d12 /tests/auto/qml/qqmlecmascript | |
parent | b46b2e28b39443f6250c0d751a593b35af1c8c1e (diff) |
Change function signatures for call/construct back
Change those back again to return a value. This will be required
to avoid creation of Scope objects between JS function calls.
Change-Id: I05cb5cf8fd0c13dcefa60d213ccd5983fab57ea3
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 45f312e934..22251111d5 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -2349,7 +2349,7 @@ static inline bool evaluate_error(QV8Engine *engine, const QV4::Value &o, const QV4::ScopedCallData d(scope, 1); d->args[0] = o; d->thisObject = engine->global(); - function->call(scope, d); + function->call(d); if (scope.engine->hasException) { scope.engine->catchException(); return true; @@ -2375,15 +2375,16 @@ static inline bool evaluate_value(QV8Engine *engine, const QV4::Value &o, if (!function) return false; + QV4::ScopedValue value(scope); QV4::ScopedCallData d(scope, 1); d->args[0] = o; d->thisObject = engine->global(); - function->call(scope, d); + value = function->call(d); if (scope.engine->hasException) { scope.engine->catchException(); return false; } - return QV4::Runtime::method_strictEqual(scope.result, result); + return QV4::Runtime::method_strictEqual(value, result); } static inline QV4::ReturnedValue evaluate(QV8Engine *engine, const QV4::Value &o, @@ -2407,12 +2408,12 @@ static inline QV4::ReturnedValue evaluate(QV8Engine *engine, const QV4::Value &o QV4::ScopedCallData d(scope, 1); d->args[0] = o; d->thisObject = engine->global(); - function->call(scope, d); + QV4::ScopedValue result(scope, function->call(d)); if (scope.engine->hasException) { scope.engine->catchException(); return QV4::Encode::undefined(); } - return scope.result.asReturnedValue(); + return result->asReturnedValue(); } #define EVALUATE_ERROR(source) evaluate_error(engine, object, source) |