aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4functionobject.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/qv4functionobject.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/qv4functionobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 888be1733e..02ea3ff788 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -293,13 +293,16 @@ FunctionPrototype::FunctionPrototype(InternalClass *ic)
{
}
-void FunctionPrototype::init(ExecutionEngine *engine, const Value &ctor)
+void FunctionPrototype::init(ExecutionEngine *engine, ObjectRef ctor)
{
- ctor.objectValue()->defineReadonlyProperty(engine->id_length, Primitive::fromInt32(1));
- ctor.objectValue()->defineReadonlyProperty(engine->id_prototype, Value::fromObject(this));
+ Scope scope(engine);
+ ScopedObject o(scope);
+
+ ctor->defineReadonlyProperty(engine->id_length, Primitive::fromInt32(1));
+ ctor->defineReadonlyProperty(engine->id_prototype, (o = this));
defineReadonlyProperty(engine->id_length, Primitive::fromInt32(0));
- defineDefaultProperty(QStringLiteral("constructor"), ctor);
+ defineDefaultProperty(QStringLiteral("constructor"), (o = ctor));
defineDefaultProperty(engine->id_toString, method_toString, 0);
defineDefaultProperty(QStringLiteral("apply"), method_apply, 2);
defineDefaultProperty(QStringLiteral("call"), method_call, 1);