diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-27 17:04:42 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-30 08:05:51 +0200 |
commit | c0ec918787068fcf269925b13a34115ff77c3126 (patch) | |
tree | 9e1a511baf5f7e1ff53a102294b28a839d2f10f5 /src/qml/jsruntime/qv4runtime.cpp | |
parent | e57c2c8a0adef8949f69195573d149237814bed1 (diff) |
Remove some uses of raw Object pointers
Change-Id: I7c715f33d197ebbf6f0c00040099b27ed7221d42
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index dabd9ad84b..09fe578c19 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -959,18 +959,16 @@ ReturnedValue __qmljs_call_activation_property(ExecutionContext *context, const Q_ASSERT(callData->thisObject.isUndefined()); Scope scope(context); - Object *base; - ScopedValue func(scope, context->getPropertyAndBase(name, &base)); + ScopedObject base(scope); + ScopedValue func(scope, context->getPropertyAndBase(name, base)); if (base) callData->thisObject = base; FunctionObject *o = func->asFunctionObject(); if (!o) { QString objectAsString = QStringLiteral("[null]"); - if (base) { - ScopedValue b(scope, base); - objectAsString = b->toQStringNoThrow(); - } + if (base) + objectAsString = ScopedValue(scope, base.asReturnedValue())->toQStringNoThrow(); QString msg = QStringLiteral("Property '%1' of object %2 is not a function").arg(name->toQString()).arg(objectAsString); context->throwTypeError(msg); } @@ -1148,7 +1146,8 @@ QV4::ReturnedValue __qmljs_builtin_typeof_element(ExecutionContext *context, con ExecutionContext *__qmljs_builtin_push_with_scope(const ValueRef o, ExecutionContext *ctx) { - Object *obj = o->toObject(ctx); + Scope scope(ctx); + ScopedObject obj(scope, o->toObject(ctx)); return ctx->newWithContext(obj); } |