aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4objectiterator.cpp4
-rw-r--r--src/qml/jsruntime/qv4objectiterator_p.h28
2 files changed, 17 insertions, 15 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp
index e5f693c323..b0219cdff4 100644
--- a/src/qml/jsruntime/qv4objectiterator.cpp
+++ b/src/qml/jsruntime/qv4objectiterator.cpp
@@ -197,7 +197,7 @@ DEFINE_OBJECT_VTABLE(ForEachIteratorObject);
void ForEachIteratorObject::markObjects(Managed *that, ExecutionEngine *e)
{
ForEachIteratorObject *o = static_cast<ForEachIteratorObject *>(that);
- o->workArea[0].mark(e);
- o->workArea[1].mark(e);
+ o->d()->workArea[0].mark(e);
+ o->d()->workArea[1].mark(e);
Object::markObjects(that, e);
}
diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h
index b914990ccd..05909742f7 100644
--- a/src/qml/jsruntime/qv4objectiterator_p.h
+++ b/src/qml/jsruntime/qv4objectiterator_p.h
@@ -83,29 +83,31 @@ struct Q_QML_EXPORT ObjectIterator
};
struct ForEachIteratorObject: Object {
- V4_OBJECT
- Q_MANAGED_TYPE(ForeachIteratorObject)
- struct Data {
- Data(Value *scratch1, Value *scratch2, const ObjectRef o, uint flags)
- : it(scratch1, scratch2, o, flags) {}
- Data(Scope &scope, const ObjectRef o, uint flags)
- : it (scope, o, flags) {}
+ struct Data : Object::Data {
+ Data(const ObjectRef o, uint flags)
+ : it(workArea, workArea + 1, o, flags) {}
ObjectIterator it;
+ Value workArea[2];
};
- Data data;
+ struct _Data {
+ _Data(const ObjectRef o, uint flags)
+ : it(workArea, workArea + 1, o, flags) {}
+ ObjectIterator it;
+ Value workArea[2];
+ } __data;
+ V4_OBJECT_NEW
+ Q_MANAGED_TYPE(ForeachIteratorObject)
ForEachIteratorObject(ExecutionContext *ctx, const ObjectRef o)
- : Object(ctx->engine), data(workArea, workArea + 1,
- o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) {
+ : Object(ctx->engine)
+ , __data(o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) {
setVTable(staticVTable());
}
- ReturnedValue nextPropertyName() { return data.it.nextPropertyNameAsString(); }
+ ReturnedValue nextPropertyName() { return d()->it.nextPropertyNameAsString(); }
protected:
static void markObjects(Managed *that, ExecutionEngine *e);
-
- Value workArea[2];
};