diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-17 22:33:48 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | 2d781c4ca42f50643fa37200073a2fb2644b3806 (patch) | |
tree | 9554dbea266f6fbb7820db018e39624b6c0f1353 /src/qml/qml/qqmlcomponent.cpp | |
parent | 21198a676128a52e892557bc434035bcd1ddfaac (diff) |
Cleanup ExecutionEngine::newBuiltinFunction() usages
And change the return type to be GC safe
Change-Id: I6d7513962370fea4072a3d8c6b2c6f2d1705992e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcomponent.cpp')
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 623efb54b2..095da5d906 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1402,24 +1402,15 @@ void QQmlComponentPrivate::initializeObjectWithInitialProperties(const QV4::Valu } } -#define V4FUNCTION(function, engine) engine->newBuiltinFunction(engine->rootContext, engine->id_undefined, function) - - QQmlComponentExtension::QQmlComponentExtension(QV8Engine *engine) { QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); QV4::Scope scope(v4); QV4::Scoped<QV4::Object> proto(scope, v4->newObject()); - QV4::Property *s = proto->insertMember(v4->newString(QStringLiteral("onStatusChanged")), - QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); - s->setGetter(V4FUNCTION(QmlIncubatorObject::method_get_statusChanged, v4)); - s->setSetter(V4FUNCTION(QmlIncubatorObject::method_set_statusChanged, v4)); - s = proto->insertMember(v4->newString(QStringLiteral("status")), - QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); - s->setGetter(V4FUNCTION(QmlIncubatorObject::method_get_status, v4)); - s = proto->insertMember(v4->newString(QStringLiteral("object")), - QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); - s->setGetter(V4FUNCTION(QmlIncubatorObject::method_get_object, v4)); + proto->defineAccessorProperty(v4->newString(QStringLiteral("onStatusChanged")), + QmlIncubatorObject::method_get_statusChanged, QmlIncubatorObject::method_set_statusChanged); + proto->defineAccessorProperty(v4->newString(QStringLiteral("status")), QmlIncubatorObject::method_get_status, 0); + proto->defineAccessorProperty(v4->newString(QStringLiteral("object")), QmlIncubatorObject::method_get_object, 0); proto->defineDefaultProperty(v4, QStringLiteral("forceCompletion"), QmlIncubatorObject::method_forceCompletion); incubationProto = proto; |