aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-05-08 14:35:30 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:14 +0200
commite8746aeaecc4b1cfe312d8ed943ad74bd53f66e2 (patch)
treef4f391707da4054502b4826eedec5cc80bfe0a1c /src/qml/jsruntime/qv4object.cpp
parent0732e0177e62590c812f0fea9c32f7d427bd933f (diff)
Start implement new Object creation pattern
Create objects through a static create() method that returns a pointer to the objects Data. This will later on simplify breaking the direct connection between Object and Object::Data. Change-Id: Id8daa3c766429bc36f432868e1957846147c96b6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r--src/qml/jsruntime/qv4object.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index a9218cad35..9abfb252ce 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -70,6 +70,16 @@ using namespace QV4;
DEFINE_OBJECT_VTABLE(Object);
+Object::Data::Data(InternalClass *internalClass)
+ : Managed::Data(internalClass)
+{
+ if (internalClass->size) {
+ Scope scope(internalClass->engine);
+ ScopedObject o(scope, this);
+ o->memberData().ensureIndex(internalClass->engine, internalClass->size);
+ }
+}
+
Object::Object(ExecutionEngine *engine)
: Managed(engine->objectClass)
{