aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4objectproto.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-12 22:37:41 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:13:55 +0200
commita2d115fbaffee282a1d32ed92c6700e6c3dd811b (patch)
tree7694e53751edd605d99d1d8eb19c9cd5d6d8188a /src/qml/jsruntime/qv4objectproto.cpp
parent399f88f6b75bb842be8e9d3671ace5114e115542 (diff)
Convert most remaining return values from Value to ReturnedValue
Change-Id: If8b0c3b91be50678693868c10fefc3678008834d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
-rw-r--r--src/qml/jsruntime/qv4objectproto.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp
index da66b2436b..fe041f0bd7 100644
--- a/src/qml/jsruntime/qv4objectproto.cpp
+++ b/src/qml/jsruntime/qv4objectproto.cpp
@@ -352,14 +352,16 @@ ReturnedValue ObjectPrototype::method_keys(SimpleCallContext *ctx)
if (!ctx->argument(0).isObject())
ctx->throwTypeError();
+ Scope scope(ctx);
Object *o = ctx->argument(0).objectValue();
ArrayObject *a = ctx->engine->newArrayObject();
ObjectIterator it(o, ObjectIterator::EnumerableOnly);
+ ScopedValue name(scope);
while (1) {
- Value name = it.nextPropertyNameAsString();
- if (name.isNull())
+ name = it.nextPropertyNameAsString();
+ if (name->isNull())
break;
a->push_back(name);
}
@@ -605,15 +607,17 @@ ReturnedValue ObjectPrototype::fromPropertyDescriptor(ExecutionContext *ctx, con
ArrayObject *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const Value &o)
{
+ Scope scope(v4);
ArrayObject *array = v4->newArrayObject();
Object *O = o.asObject();
if (!O)
return array;
ObjectIterator it(O, ObjectIterator::NoFlags);
+ ScopedValue name(scope);
while (1) {
- Value name = it.nextPropertyNameAsString();
- if (name.isNull())
+ name = it.nextPropertyNameAsString();
+ if (name->isNull())
break;
array->push_back(name);
}