aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4script.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-06-15 15:52:51 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-18 18:24:21 +0000
commit3e3e9343737ec18ef0579c0bb70c5fecdd3169f0 (patch)
tree722230b33c997080cfdae5f32fdc921d3059b0a0 /src/qml/jsruntime/qv4script.cpp
parentf077bf13efee6d57261f76544e89a10acafb5a9c (diff)
Add some typesafety
Even though the goal is to get rid of the contextwrapper, this helps in the meantime. Change-Id: I234ef39f74fb0eee78710884de6a1c90763bce74 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r--src/qml/jsruntime/qv4script.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index c7dd28e795..767614c137 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -87,7 +87,7 @@ using namespace QV4;
DEFINE_OBJECT_VTABLE(QmlBindingWrapper);
DEFINE_OBJECT_VTABLE(CompilationUnitHolder);
-Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, Function *f, QV4::Object *qml)
+Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, Function *f, QV4::QmlContextWrapper *qml)
: Heap::FunctionObject(scope, scope->d()->engine->id_eval(), /*createProto = */ false)
, qml(qml->d())
{
@@ -106,7 +106,7 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, Functio
s.engine->popContext();
}
-Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, QV4::Object *qml)
+Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, QV4::QmlContextWrapper *qml)
: Heap::FunctionObject(scope, scope->d()->engine->id_eval(), /*createProto = */ false)
, qml(qml->d())
{
@@ -163,7 +163,7 @@ Heap::FunctionObject *QmlBindingWrapper::createQmlCallableForFunction(QQmlContex
{
ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(qmlContext->engine);
QV4::Scope valueScope(engine);
- QV4::ScopedObject qmlScopeObject(valueScope, QV4::QmlContextWrapper::qmlScope(engine, qmlContext, scopeObject));
+ 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());
@@ -299,7 +299,7 @@ ReturnedValue Script::run()
return vmFunction->code(engine, vmFunction->codeData);
} else {
- ScopedObject qmlObj(valueScope, qml.value());
+ Scoped<QmlContextWrapper> qmlObj(valueScope, qml.value());
ScopedFunctionObject f(valueScope, engine->memoryManager->alloc<QmlBindingWrapper>(scope, vmFunction, qmlObj));
ScopedCallData callData(valueScope);
callData->thisObject = Primitive::undefinedValue();
@@ -377,7 +377,7 @@ ReturnedValue Script::qmlBinding()
parse();
ExecutionEngine *v4 = scope->engine();
Scope valueScope(v4);
- ScopedObject qmlObj(valueScope, qml.value());
+ Scoped<QmlContextWrapper> qmlObj(valueScope, qml.value());
ScopedObject v(valueScope, v4->memoryManager->alloc<QmlBindingWrapper>(scope, vmFunction, qmlObj));
return v.asReturnedValue();
}