aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arrayobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-26 13:05:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-28 13:33:58 +0200
commit62d1b5a08aa2c21c95a2a77afbe34c38ed37a2aa (patch)
treed9e542dfb9d7fa5d8e1c71633f6cd18cf234b5e6 /src/qml/jsruntime/qv4arrayobject.cpp
parent112531bc23494ba3c5cf2e0a51b2d654be28dbfd (diff)
Fix API for Object::define*Property
use ValueRef instead of const Value &. Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4arrayobject.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp
index ea4d174bb7..7051276f4c 100644
--- a/src/qml/jsruntime/qv4arrayobject.cpp
+++ b/src/qml/jsruntime/qv4arrayobject.cpp
@@ -91,12 +91,14 @@ ArrayPrototype::ArrayPrototype(InternalClass *ic)
{
}
-void ArrayPrototype::init(ExecutionEngine *engine, const Value &ctor)
+void ArrayPrototype::init(ExecutionEngine *engine, ObjectRef ctor)
{
- ctor.objectValue()->defineReadonlyProperty(engine->id_length, Primitive::fromInt32(1));
- ctor.objectValue()->defineReadonlyProperty(engine->id_prototype, Value::fromObject(this));
- ctor.objectValue()->defineDefaultProperty(QStringLiteral("isArray"), method_isArray, 1);
- defineDefaultProperty(QStringLiteral("constructor"), ctor);
+ Scope scope(engine);
+ ScopedObject o(scope);
+ ctor->defineReadonlyProperty(engine->id_length, Primitive::fromInt32(1));
+ ctor->defineReadonlyProperty(engine->id_prototype, (o = this));
+ ctor->defineDefaultProperty(QStringLiteral("isArray"), method_isArray, 1);
+ defineDefaultProperty(QStringLiteral("constructor"), (o = ctor));
defineDefaultProperty(engine->id_toString, method_toString, 0);
defineDefaultProperty(QStringLiteral("toLocaleString"), method_toLocaleString, 0);
defineDefaultProperty(QStringLiteral("concat"), method_concat, 1);