From 9306c05dd152511b8b938d7899a7bdf1aeb8d1c2 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 21 Nov 2013 16:41:32 +0100 Subject: Encapsulate the current context and fix it's usage Encapsulate accesses to the current context, and rework the way we push and pop this context from the context stack. Largely a cleanup, but simplifies the code in the long term Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlecmascript/testtypes.cpp | 2 +- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/qml/qqmlecmascript') diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp index 41fa3672bd..22fac2013e 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.cpp +++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp @@ -106,7 +106,7 @@ public: void MyQmlObject::v8function(QQmlV4Function *function) { - QV8Engine::getV4(function->engine())->current->throwError(QStringLiteral("Exception thrown from within QObject slot")); + QV8Engine::getV4(function->engine())->currentContext()->throwError(QStringLiteral("Exception thrown from within QObject slot")); } static QJSValue script_api(QQmlEngine *engine, QJSEngine *scriptEngine) diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 660be13f71..1e18e3c269 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -2267,7 +2267,7 @@ static inline bool evaluate_error(QV8Engine *engine, const QV4::ValueRef o, cons QV4::Script program(QV8Engine::getV4(engine)->rootContext, functionSource); program.inheritContext = true; - QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->current; + QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->currentContext(); QV4::Scope scope(ctx); QV4::Scoped function(scope, program.run()); @@ -2295,7 +2295,7 @@ static inline bool evaluate_value(QV8Engine *engine, const QV4::ValueRef o, QV4::Script program(QV8Engine::getV4(engine)->rootContext, functionSource); program.inheritContext = true; - QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->current; + QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->currentContext(); QV4::Scope scope(ctx); QV4::Scoped function(scope, program.run()); @@ -2324,7 +2324,7 @@ static inline QV4::ReturnedValue evaluate(QV8Engine *engine, const QV4::ValueRef QString functionSource = QLatin1String("(function(object) { return ") + QLatin1String(source) + QLatin1String(" })"); - QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->current; + QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->currentContext(); QV4::Scope scope(ctx); QV4::Script program(QV8Engine::getV4(engine)->rootContext, functionSource); -- cgit v1.2.3