aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-11-21 16:41:32 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-04 09:45:50 +0100
commit9306c05dd152511b8b938d7899a7bdf1aeb8d1c2 (patch)
tree514b6cda632244d7f9e7fdb1af143da05b7b1ce0 /src/qml/jsruntime/qv4value.cpp
parent0f32303e5cc9c539aa8698cab2b8cc2e946d885a (diff)
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 <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4value.cpp')
-rw-r--r--src/qml/jsruntime/qv4value.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp
index 4ae570c8dc..30f7e8cdb0 100644
--- a/src/qml/jsruntime/qv4value.cpp
+++ b/src/qml/jsruntime/qv4value.cpp
@@ -90,7 +90,7 @@ double Value::toNumberImpl() const
if (isString())
return __qmljs_string_to_number(stringValue()->toQString());
{
- ExecutionContext *ctx = objectValue()->internalClass->engine->current;
+ ExecutionContext *ctx = objectValue()->internalClass->engine->currentContext();
Scope scope(ctx);
ScopedValue prim(scope, __qmljs_to_primitive(ValueRef::fromRawValue(this), NUMBER_HINT));
return prim->toNumber();
@@ -121,7 +121,7 @@ QString Value::toQStringNoThrow() const
if (isString())
return stringValue()->toQString();
{
- ExecutionContext *ctx = objectValue()->internalClass->engine->current;
+ ExecutionContext *ctx = objectValue()->internalClass->engine->currentContext();
Scope scope(ctx);
ScopedValue ex(scope);
bool caughtException = false;
@@ -174,7 +174,7 @@ QString Value::toQString() const
if (isString())
return stringValue()->toQString();
{
- ExecutionContext *ctx = objectValue()->internalClass->engine->current;
+ ExecutionContext *ctx = objectValue()->internalClass->engine->currentContext();
Scope scope(ctx);
ScopedValue prim(scope, __qmljs_to_primitive(ValueRef::fromRawValue(this), STRING_HINT));
return prim->toQString();