aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-08-02 16:16:09 +0200
committerLars Knoll <lars.knoll@qt.io>2018-08-02 20:25:49 +0000
commit0d63c22eee293fe59d7691608deaaf3468045eb3 (patch)
treee54d53a183d91efc8e4e7089d4bbc5964f4badce /src
parent0754f55287f4652382332bce42cd8c7d27846ef1 (diff)
Remove support for iterating over the proto chain from ObjectIterator
This will simplify moving over to the new iteration model. It implies a very small behavioral change in a few places where we used to iterate over the proto chain before. Change-Id: Ia62c9c51712d6b45e69ca63becdbefab6fa4bf3f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/localstorage/plugin.cpp2
-rw-r--r--src/qml/jsruntime/qv4objectiterator.cpp5
-rw-r--r--src/qml/jsruntime/qv4objectiterator_p.h3
-rw-r--r--src/qml/qml/qqmlcomponent.cpp2
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp2
-rw-r--r--src/qml/types/qqmllistmodel.cpp4
6 files changed, 7 insertions, 11 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index ae1ee2e378..15037b6a3a 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -305,7 +305,7 @@ static ReturnedValue qmlsqldatabase_executeSql(const FunctionObject *b, const Va
}
} else if (values->as<Object>()) {
ScopedObject object(scope, values);
- ObjectIterator it(scope, object, ObjectIterator::WithProtoChain|ObjectIterator::EnumerableOnly);
+ ObjectIterator it(scope, object, ObjectIterator::EnumerableOnly);
ScopedValue key(scope);
QV4::ScopedValue val(scope);
while (1) {
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp
index d4e07e3d77..a6af3ecf9b 100644
--- a/src/qml/jsruntime/qv4objectiterator.cpp
+++ b/src/qml/jsruntime/qv4objectiterator.cpp
@@ -104,10 +104,7 @@ void ObjectIterator::next(Value *name, uint *index, Property *pd, PropertyAttrib
return;
}
- if (flags & WithProtoChain)
- current->setM(co->getPrototypeOf());
- else
- current->setM(nullptr);
+ current->setM(nullptr);
arrayIndex = 0;
memberIndex = 0;
diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h
index 20eb918e12..ca40748b79 100644
--- a/src/qml/jsruntime/qv4objectiterator_p.h
+++ b/src/qml/jsruntime/qv4objectiterator_p.h
@@ -61,8 +61,7 @@ struct Q_QML_EXPORT ObjectIteratorData
{
enum Flags {
NoFlags = 0,
- EnumerableOnly = 0x1,
- WithProtoChain = 0x2,
+ EnumerableOnly = 0x1
};
ExecutionEngine *engine;
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 6a6e5e8d68..45b0f18530 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -1223,7 +1223,7 @@ void QQmlComponentPrivate::setInitialProperties(QV4::ExecutionEngine *engine, QV
QV4::Scope scope(engine);
QV4::ScopedObject object(scope);
QV4::ScopedObject valueMap(scope, v);
- QV4::ObjectIterator it(scope, valueMap, QV4::ObjectIterator::EnumerableOnly|QV4::ObjectIterator::WithProtoChain);
+ QV4::ObjectIterator it(scope, valueMap, QV4::ObjectIterator::EnumerableOnly);
QV4::ScopedString name(scope);
QV4::ScopedValue val(scope);
if (engine->hasException)
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index d9adb7808e..bf2fe3b52a 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -1746,7 +1746,7 @@ bool QQmlDelegateModelPrivate::insert(Compositor::insert_iterator &before, const
if (!o)
return false;
- QV4::ObjectIterator it(scope, o, QV4::ObjectIterator::EnumerableOnly|QV4::ObjectIterator::WithProtoChain);
+ QV4::ObjectIterator it(scope, o, QV4::ObjectIterator::EnumerableOnly);
QV4::ScopedValue propertyName(scope);
QV4::ScopedValue v(scope);
while (1) {
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index c6597b49f3..30e5b83d5c 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -563,7 +563,7 @@ void ListModel::set(int elementIndex, QV4::Object *object, QVector<int> *roles)
QV4::Scope scope(v4);
QV4::ScopedObject o(scope);
- QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::WithProtoChain|QV4::ObjectIterator::EnumerableOnly);
+ QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::EnumerableOnly);
QV4::ScopedString propertyName(scope);
QV4::ScopedValue propertyValue(scope);
while (1) {
@@ -642,7 +642,7 @@ void ListModel::set(int elementIndex, QV4::Object *object)
QV4::ExecutionEngine *v4 = object->engine();
QV4::Scope scope(v4);
- QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::WithProtoChain|QV4::ObjectIterator::EnumerableOnly);
+ QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::EnumerableOnly);
QV4::ScopedString propertyName(scope);
QV4::ScopedValue propertyValue(scope);
QV4::ScopedObject o(scope);