aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4objectproto.cpp
diff options
context:
space:
mode:
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();
}