diff options
author | Chris Adams <christopher.adams@nokia.com> | 2011-11-21 10:02:35 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-29 04:34:11 +0100 |
commit | c648598a8ba8bf72b5d556211df877578d5f5b64 (patch) | |
tree | 47cfe3fe9ac48fdd609ac51e5351de925da7dec2 /src/declarative/qml/v8/qv8sequencewrapper_p.h | |
parent | 5587885a71b962eb9443c1f83e3e477490bd691d (diff) |
Add indexed deleter to sequence wrapper, implement length setter
Previously, elements could not be deleted from sequences directly
without reassignment. This commit adds an indexed deleter which
allows elements to be deleted by specifying an index. A deleted
element will be replaced with a default-constructed element in the
sequence (slight departure from ECMA262r3 which specifies that it
should be replaced with Undefined).
This commit also implements the length property setter according
to the requirements on Array [[Put]] by ECMA262r3 which allows
removal of elements from a sequence (required for proper behaviour
of Array.prototype methods such as splice() and pop()).
Task-number: QTBUG-22808
Change-Id: I62511b3edc2ec35f92d2a2bd719278e129c98547
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qv8sequencewrapper_p.h')
-rw-r--r-- | src/declarative/qml/v8/qv8sequencewrapper_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/qml/v8/qv8sequencewrapper_p.h b/src/declarative/qml/v8/qv8sequencewrapper_p.h index da0f7eacca..0ddeed9eda 100644 --- a/src/declarative/qml/v8/qv8sequencewrapper_p.h +++ b/src/declarative/qml/v8/qv8sequencewrapper_p.h @@ -88,8 +88,10 @@ private: static v8::Handle<v8::Value> IndexedGetter(quint32 index, const v8::AccessorInfo &info); static v8::Handle<v8::Value> IndexedSetter(quint32 index, v8::Local<v8::Value> value, const v8::AccessorInfo &info); + static v8::Handle<v8::Boolean> IndexedDeleter(quint32 index, const v8::AccessorInfo &info); static v8::Handle<v8::Array> IndexedEnumerator(const v8::AccessorInfo &info); static v8::Handle<v8::Value> LengthGetter(v8::Local<v8::String> property, const v8::AccessorInfo &info); + static void LengthSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo &info); static v8::Handle<v8::Value> ToStringGetter(v8::Local<v8::String> property, const v8::AccessorInfo &info); static v8::Handle<v8::Value> ToString(const v8::Arguments &args); static v8::Handle<v8::Value> ValueOfGetter(v8::Local<v8::String> property, const v8::AccessorInfo &info); |