diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-26 13:05:25 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:58 +0200 |
commit | 62d1b5a08aa2c21c95a2a77afbe34c38ed37a2aa (patch) | |
tree | d9e542dfb9d7fa5d8e1c71633f6cd18cf234b5e6 /src/qml/jsruntime/qv4dateobject.cpp | |
parent | 112531bc23494ba3c5cf2e0a51b2d654be28dbfd (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/qv4dateobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index cb5c37d421..ffc5fa891a 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -701,17 +701,19 @@ ReturnedValue DateCtor::call(Managed *m, CallData *) return m->engine()->newString(ToString(t))->asReturnedValue(); } -void DatePrototype::init(ExecutionEngine *engine, const Value &ctor) +void DatePrototype::init(ExecutionEngine *engine, ObjectRef ctor) { - ctor.objectValue()->defineReadonlyProperty(engine->id_prototype, Value::fromObject(this)); - ctor.objectValue()->defineReadonlyProperty(engine->id_length, Primitive::fromInt32(7)); + Scope scope(engine); + ScopedObject o(scope); + ctor->defineReadonlyProperty(engine->id_prototype, (o = this)); + ctor->defineReadonlyProperty(engine->id_length, Primitive::fromInt32(7)); LocalTZA = getLocalTZA(); - ctor.objectValue()->defineDefaultProperty(QStringLiteral("parse"), method_parse, 1); - ctor.objectValue()->defineDefaultProperty(QStringLiteral("UTC"), method_UTC, 7); - ctor.objectValue()->defineDefaultProperty(QStringLiteral("now"), method_now, 0); + ctor->defineDefaultProperty(QStringLiteral("parse"), method_parse, 1); + ctor->defineDefaultProperty(QStringLiteral("UTC"), method_UTC, 7); + ctor->defineDefaultProperty(QStringLiteral("now"), method_now, 0); - defineDefaultProperty(QStringLiteral("constructor"), ctor); + defineDefaultProperty(QStringLiteral("constructor"), (o = ctor)); defineDefaultProperty(engine->id_toString, method_toString, 0); defineDefaultProperty(QStringLiteral("toDateString"), method_toDateString, 0); defineDefaultProperty(QStringLiteral("toTimeString"), method_toTimeString, 0); |