aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4script.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-14 09:20:42 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-08-25 03:45:49 +0000
commit9eab0161f465c35b996fad9451ad07c5b0c2b38d (patch)
treebc1c149b3e695a5c8e6cd5b151cc6cf5ea328309 /src/qml/jsruntime/qv4script.cpp
parentc962f3c8e874f21743684a52ee520939ae1be938 (diff)
Create less BindingWrappers
Instead create QmlContext's directly as they are the only thing used from the binding wrapper. Change-Id: If3a987134dee9e85b6a76ed74aacd76b19279117 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r--src/qml/jsruntime/qv4script.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index 14b8b878bd..7067d10e22 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -104,18 +104,6 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, Functio
internalClass->engine->popContext();
}
-Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, QV4::QmlContextWrapper *qml)
- : Heap::FunctionObject(scope, scope->d()->engine->id_eval(), /*createProto = */ false)
-{
- Q_ASSERT(scope->inUse());
-
- Scope s(scope);
- Scoped<QV4::QmlBindingWrapper> protectThis(s, this);
-
- this->scope = scope->newQmlContext(qml);
- internalClass->engine->popContext();
-}
-
ReturnedValue QmlBindingWrapper::call(const Managed *that, CallData *callData)
{
const QmlBindingWrapper *This = static_cast<const QmlBindingWrapper *>(that);
@@ -152,8 +140,8 @@ Heap::FunctionObject *QmlBindingWrapper::createQmlCallableForFunction(QQmlContex
QV4::Scope valueScope(engine);
QV4::Scoped<QmlContextWrapper> qmlScopeObject(valueScope, QV4::QmlContextWrapper::qmlScope(engine, qmlContext, scopeObject));
ScopedContext global(valueScope, valueScope.engine->rootContext());
- QV4::Scoped<QV4::QmlBindingWrapper> wrapper(valueScope, engine->memoryManager->alloc<QV4::QmlBindingWrapper>(global, qmlScopeObject));
- QV4::Scoped<QmlContext> wrapperContext(valueScope, wrapper->context());
+ QV4::Scoped<QmlContext> wrapperContext(valueScope, global->newQmlContext(qmlScopeObject));
+ engine->popContext();
if (!signalParameters.isEmpty()) {
if (error)