Add indexed deleter to sequence wrapper, implement length setter
authorChris Adams <christopher.adams@nokia.com>
Mon, 21 Nov 2011 00:02:35 +0000 (10:02 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 29 Nov 2011 03:34:11 +0000 (04:34 +0100)
commitc648598a8ba8bf72b5d556211df877578d5f5b64
tree47cfe3fe9ac48fdd609ac51e5351de925da7dec2
parent5587885a71b962eb9443c1f83e3e477490bd691d
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>
doc/src/declarative/extending.qdoc
src/declarative/qml/v8/qv8sequencewrapper.cpp
src/declarative/qml/v8/qv8sequencewrapper_p.h
src/declarative/qml/v8/qv8sequencewrapper_p_p.h
tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.array.qml
tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp