diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-22 15:34:57 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-02 19:29:25 +0000 |
commit | 98263a01373f5b225d64da216537165ae27d7ff1 (patch) | |
tree | 60980c16c6cc6f6658355bcd428245819b4b732a /src/qml/jsruntime/qv4sequenceobject.cpp | |
parent | d21ef386ece52490d428daacb8f7f4658e9f78e5 (diff) |
Unify put and putIndexed
Pass an Identifier through those virtual methods to unify
the string and integer based versions.
Also add the receiver that's required in ES7
Change-Id: I4e7f01b4c97cc80bcb3c485f6343f28213dc9e6b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4sequenceobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index f6f8e51e19..74964916ee 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -565,8 +565,12 @@ public: static QV4::ReturnedValue getIndexed(const QV4::Managed *that, uint index, bool *hasProperty) { return static_cast<const QQmlSequence<Container> *>(that)->containerGetIndexed(index, hasProperty); } - static bool putIndexed(Managed *that, uint index, const QV4::Value &value) - { return static_cast<QQmlSequence<Container> *>(that)->containerPutIndexed(index, value); } + static bool put(Managed *that, Identifier id, const QV4::Value &value, Value *receiver) + { + if (id.isArrayIndex()) + return static_cast<QQmlSequence<Container> *>(that)->containerPutIndexed(id.asArrayIndex(), value); + return Object::put(that, id, value, receiver); + } static QV4::PropertyAttributes queryIndexed(const QV4::Managed *that, uint index) { return static_cast<const QQmlSequence<Container> *>(that)->containerQueryIndexed(index); } static bool deleteProperty(QV4::Managed *that, Identifier id) |