diff options
author | Lars Knoll <[email protected]> | 2015-06-12 13:07:39 +0200 |
---|---|---|
committer | Simon Hausmann <[email protected]> | 2015-06-19 15:24:55 +0000 |
commit | 9fd6ccb582166b684550a5805e895292302b4e12 (patch) | |
tree | 5c631d94d6c056ee05507c6a4a0df17880fb9816 /src/qml/jsruntime/qv4script.cpp | |
parent | 1bedf1aead29cd3030969e855958185990def071 (diff) |
Smaller code cleanups
Change-Id: Id3bc6ea5615a462d7a41ceb1fa18b4fb090e0d51
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index 767614c137..576488275e 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -98,12 +98,10 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, Functio function->compilationUnit->addref(); Scope s(scope); - Scoped<QV4::QmlBindingWrapper> o(s, this); + Scoped<QV4::QmlBindingWrapper> protectThis(s, this); - o->defineReadonlyProperty(scope->d()->engine->id_length(), Primitive::fromInt32(1)); - - o->d()->scope = ScopedContext(s, o->scope())->newQmlContext(qml); - s.engine->popContext(); + this->scope = scope->newQmlContext(qml); + internalClass->engine->popContext(); } Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, QV4::QmlContextWrapper *qml) @@ -113,23 +111,21 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, QV4::Qm Q_ASSERT(scope->inUse()); Scope s(scope); - Scoped<QV4::QmlBindingWrapper> o(s, this); - - o->defineReadonlyProperty(scope->d()->engine->id_length(), Primitive::fromInt32(1)); + Scoped<QV4::QmlBindingWrapper> protectThis(s, this); - o->d()->scope = ScopedContext(s, o->scope())->newQmlContext(qml); - s.engine->popContext(); + this->scope = scope->newQmlContext(qml); + internalClass->engine->popContext(); } ReturnedValue QmlBindingWrapper::call(const Managed *that, CallData *callData) { + const QmlBindingWrapper *This = static_cast<const QmlBindingWrapper *>(that); ExecutionEngine *v4 = static_cast<const Object *>(that)->engine(); if (v4->hasException) return Encode::undefined(); CHECK_STACK_LIMITS(v4); Scope scope(v4); - Scoped<QmlBindingWrapper> This(scope, static_cast<const QmlBindingWrapper *>(that)); QV4::Function *f = This->function(); if (!f) return QV4::Encode::undefined(); |