aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4objectproto.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-14 11:25:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:14:13 +0200
commitf79df5da0769836bc866b470cdac43d6363dc7db (patch)
tree28deb1584b6c43dca92b39328bcf43099a92fcd6 /src/qml/jsruntime/qv4objectproto.cpp
parente4e90923c93adfafb23c81be7359e8df2a500b4f (diff)
Convert more methods to return a Returned<>
Change-Id: If294c9c4f574824c308b63a11da1337226180105 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
-rw-r--r--src/qml/jsruntime/qv4objectproto.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp
index fe041f0bd7..073d588e56 100644
--- a/src/qml/jsruntime/qv4objectproto.cpp
+++ b/src/qml/jsruntime/qv4objectproto.cpp
@@ -355,7 +355,7 @@ ReturnedValue ObjectPrototype::method_keys(SimpleCallContext *ctx)
Scope scope(ctx);
Object *o = ctx->argument(0).objectValue();
- ArrayObject *a = ctx->engine->newArrayObject();
+ Scoped<ArrayObject> a(scope, ctx->engine->newArrayObject());
ObjectIterator it(o, ObjectIterator::EnumerableOnly);
ScopedValue name(scope);
@@ -366,7 +366,7 @@ ReturnedValue ObjectPrototype::method_keys(SimpleCallContext *ctx)
a->push_back(name);
}
- return Value::fromObject(a).asReturnedValue();
+ return a.asReturnedValue();
}
ReturnedValue ObjectPrototype::method_toString(SimpleCallContext *ctx)
@@ -608,10 +608,10 @@ ReturnedValue ObjectPrototype::fromPropertyDescriptor(ExecutionContext *ctx, con
ArrayObject *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const Value &o)
{
Scope scope(v4);
- ArrayObject *array = v4->newArrayObject();
+ Scoped<ArrayObject> array(scope, v4->newArrayObject());
Object *O = o.asObject();
if (!O)
- return array;
+ return array.getPointer();
ObjectIterator it(O, ObjectIterator::NoFlags);
ScopedValue name(scope);
@@ -621,5 +621,5 @@ ArrayObject *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const Val
break;
array->push_back(name);
}
- return array;
+ return array.getPointer();
}