diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-21 16:41:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-04 09:45:50 +0100 |
commit | 9306c05dd152511b8b938d7899a7bdf1aeb8d1c2 (patch) | |
tree | 514b6cda632244d7f9e7fdb1af143da05b7b1ce0 /src/qml/jsruntime/qv4object.cpp | |
parent | 0f32303e5cc9c539aa8698cab2b8cc2e946d885a (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/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index e2b3b6ef62..106525d412 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -168,8 +168,8 @@ void Object::putValue(Property *pd, PropertyAttributes attrs, const ValueRef val return; reject: - if (engine()->current->strictMode) - engine()->current->throwTypeError(); + if (engine()->currentContext()->strictMode) + engine()->currentContext()->throwTypeError(); } void Object::defineDefaultProperty(const StringRef name, ValueRef value) @@ -720,7 +720,7 @@ void Object::internalPut(const StringRef name, const ValueRef value) bool ok; uint l = value->asArrayLength(&ok); if (!ok) { - engine()->current->throwRangeError(value); + engine()->currentContext()->throwRangeError(value); return; } ok = setArrayLength(l); @@ -768,11 +768,11 @@ void Object::internalPut(const StringRef name, const ValueRef value) } reject: - if (engine()->current->strictMode) { + if (engine()->currentContext()->strictMode) { QString message = QStringLiteral("Cannot assign to read-only property \""); message += name->toQString(); message += QLatin1Char('\"'); - engine()->current->throwTypeError(message); + engine()->currentContext()->throwTypeError(message); } } @@ -843,8 +843,8 @@ void Object::internalPutIndexed(uint index, const ValueRef value) return; reject: - if (engine()->current->strictMode) - engine()->current->throwTypeError(); + if (engine()->currentContext()->strictMode) + engine()->currentContext()->throwTypeError(); } // Section 8.12.7 @@ -866,8 +866,8 @@ bool Object::internalDeleteProperty(const StringRef name) memmove(memberData + memberIdx, memberData + memberIdx + 1, (internalClass->size - memberIdx)*sizeof(Property)); return true; } - if (engine()->current->strictMode) - engine()->current->throwTypeError(); + if (engine()->currentContext()->strictMode) + engine()->currentContext()->throwTypeError(); return false; } @@ -896,8 +896,8 @@ bool Object::internalDeleteIndexedProperty(uint index) return true; } - if (engine()->current->strictMode) - engine()->current->throwTypeError(); + if (engine()->currentContext()->strictMode) + engine()->currentContext()->throwTypeError(); return false; } |