diff options
Diffstat (limited to 'src/qml/jsruntime/qv4objectiterator_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4objectiterator_p.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h index c87f284288..f20ad17b4a 100644 --- a/src/qml/jsruntime/qv4objectiterator_p.h +++ b/src/qml/jsruntime/qv4objectiterator_p.h @@ -67,37 +67,38 @@ struct Q_QML_EXPORT ObjectIterator WithProtoChain = 0x2, }; - ObjectRef object; - ObjectRef current; + Value *object; + Value *current; SparseArrayNode *arrayNode; uint arrayIndex; uint memberIndex; uint flags; - ObjectIterator(Value *scratch1, Value *scratch2, const ObjectRef o, uint flags); - ObjectIterator(Scope &scope, const ObjectRef o, uint flags); - void next(StringRef name, uint *index, Property *pd, PropertyAttributes *attributes = 0); + ObjectIterator(Value *scratch1, Value *scratch2, Object *o, uint flags); + ObjectIterator(Scope &scope, Object *o, uint flags); + void next(String *&name, uint *index, Property *pd, PropertyAttributes *attributes = 0); ReturnedValue nextPropertyName(ValueRef value); ReturnedValue nextPropertyNameAsString(ValueRef value); ReturnedValue nextPropertyNameAsString(); }; struct ForEachIteratorObject: Object { - V4_OBJECT + struct Data : Object::Data { + Data(ExecutionContext *ctx, Object *o) + : Object::Data(ctx->engine()) + , it(workArea, workArea + 1, o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { + setVTable(staticVTable()); + } + ObjectIterator it; + Value workArea[2]; + }; + V4_OBJECT(Object) Q_MANAGED_TYPE(ForeachIteratorObject) - ObjectIterator it; - ForEachIteratorObject(ExecutionContext *ctx, const ObjectRef o) - : Object(ctx->engine), it(workArea, workArea + 1, - o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { - setVTable(staticVTable()); - } - ReturnedValue nextPropertyName() { return it.nextPropertyNameAsString(); } + ReturnedValue nextPropertyName() { return d()->it.nextPropertyNameAsString(); } protected: static void markObjects(Managed *that, ExecutionEngine *e); - - Value workArea[2]; }; |