aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-05 13:22:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-11 13:01:50 +0200
commit6e8e5d16e16d6ee683a5c06a24f8f202ed5239ff (patch)
treefa8e710ad0ee4ff6cc9738fa717883c74d452b95 /tests/auto/qml/qqmlecmascript
parent736afb8e9b3694efb8ca1fa8f3a8eeeaef530da2 (diff)
Move CallData onto the JS stack
Change-Id: I22e853acfd2da337344b581bb0412c5f9930c510 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 1db3bc3fe8..99659fb1eb 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -55,6 +55,7 @@
#include "../../shared/util.h"
#include <private/qv4functionobject_p.h>
#include <private/qv4exception_p.h>
+#include <private/qv4scopedvalue_p.h>
#ifdef Q_CC_MSVC
#define NO_INLINE __declspec(noinline)
@@ -2260,9 +2261,9 @@ static inline bool evaluate_error(QV8Engine *engine, const QV4::Value &o, const
QV4::FunctionObject *function = program.run().asFunctionObject();
if (!function)
return false;
- CALLDATA(1);
- d.args[0] = o;
- d.thisObject = engine->global();
+ QV4::ScopedCallData d(ctx->engine, 1);
+ d->args[0] = o;
+ d->thisObject = engine->global();
function->call(d);
} catch (QV4::Exception &e) {
e.accept(ctx);
@@ -2285,11 +2286,14 @@ static inline bool evaluate_value(QV8Engine *engine, const QV4::Value &o,
QV4::FunctionObject *function = program.run().asFunctionObject();
if (!function)
return false;
- CALLDATA(1);
- d.args[0] = o;
- d.thisObject = engine->global();
- QV4::Value value = function->call(d);
- return __qmljs_strict_equal(value, result);
+ QV4::ValueScope scope(ctx);
+ QV4::ScopedValue value(scope);
+ QV4::ScopedValue res(scope, result);
+ QV4::ScopedCallData d(ctx->engine, 1);
+ d->args[0] = o;
+ d->thisObject = engine->global();
+ value = function->call(d);
+ return __qmljs_strict_equal(value, res);
} catch (QV4::Exception &e) {
e.accept(ctx);
}
@@ -2309,9 +2313,9 @@ static inline QV4::Value evaluate(QV8Engine *engine, const QV4::Value & o,
QV4::FunctionObject *function = program.run().asFunctionObject();
if (!function)
return QV4::Value::emptyValue();
- CALLDATA(1);
- d.args[0] = o;
- d.thisObject = engine->global();
+ QV4::ScopedCallData d(ctx->engine, 1);
+ d->args[0] = o;
+ d->thisObject = engine->global();
QV4::Value value = function->call(d);
return value;
} catch (QV4::Exception &e) {