aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qv8sequencewrapper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add indexed deleter to sequence wrapper, implement length setterChris Adams2011-11-291-3/+18
| | | | | | | | | | | | | | | | | | 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>
* Remove unused codepaths from QV8SequenceWrapperChris Adams2011-11-111-25/+1
| | | | | | | | | | | | The object equality comparison callback does not allow an object with a sequence resource to be equal to an object with a variant resource. As such, the SequenceType::isEqual(QVariant) codepaths are not needed. Also, QVariantList conversion is handled by toBasicVariant() in the QV8Engine, and thus we don't need conversion code for this type in the sequence wrapper. Change-Id: I2ec599c5ad6cfdb715cd4e0aae3f0cc3bb36cfdf Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add support for more sequence typesChris Adams2011-11-021-0/+273
This commit adds support for more sequence types by adding a sequence wrapper. This class enables conversion between v8::Array and C++ sequences of various types (currently just QList<int>, QList<qreal>, QList<bool>, QList<QString>, QList<QUrl> and QStringList), but more types can be added later if required). When a JavaScript object is created from such a sequence, its prototype object is set to the v8::Array prototype object. The indexed setter, indexed getter, length and toString methods are implemented directly or in terms of the underlying sequence resource. Note that currently, sequences of ValueTypes are NOT supported, due to the fact that operations like: someObj.someValueTypeSequence[i].x = 5; would not behave as required. Task-number: QTBUG-20826 Task-number: QTBUG-21770 Change-Id: I36deb448fb0e87a32084a900e70a2604ff369309 Reviewed-by: Chris Adams <christopher.adams@nokia.com>