aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data
Commit message (Collapse)AuthorAgeFilesLines
* Fix the evaluation of JS switch statements in QML bindings.Roberto Raggi2011-11-295-0/+142
| | | | | | | Task-number: QTBUG-17012 Change-Id: Ic132cf63ed08592fec9c759df1b8b4d5830acea6 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add indexed deleter to sequence wrapper, implement length setterChris Adams2011-11-291-0/+41
| | | | | | | | | | | | | | | | | | 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>
* Don't crash when importing script with syntax errorKent Hansen2011-11-234-0/+22
| | | | | | Task-number: QTBUG-22843 Change-Id: I2b1ed6cbbc7a566f54b441359941ea121a9033ba Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix default property preventing signals from being emitted.Glenn Watson2011-11-221-0/+22
| | | | | | | | | | | | Change the way connectAlias works so that even if the target for the connection is not available immediately, anything that is bound to it is notified when the target is changed. (Fix is authored by Aaron). Task-number: QTBUG-21580 Change-Id: Ida23c0e620069c50b123c71b5078929d4c7ec4e4 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add autotest for qml/v8 optimization bugKent Hansen2011-11-161-0/+14
| | | | | | | | | | | After a function that accesses a qml context property was inlined, calls to global functions would fail with "TypeError: Illegal invocation". Fixed in qtbase's v8. Task-number: QTBUG-22679 Change-Id: Id6e2604e5151585febfe1b667869dc3b1fad6e5e Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Allow aliases to QVariant propertiesAaron Kennedy2011-11-161-0/+15
| | | | | | Task-number: QTBUG-22464 Change-Id: I449d4fc709d34a69116258660d721596cd9b778b Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix parsing of unary expressions.Roberto Raggi2011-11-141-0/+9
| | | | | | | | | | | | | | | | | | | | Prohibit the lexer to synthesize a semicolon token after the colon-sign of a binding declaration. The parser internally was rewriting the following bindings Component.onCompleted: ++foo as Component.onCompleted: ; ++foo Task-number: QTBUG-21310 Change-Id: I0558d17fd81b5abac81fb990502d49767ea40730 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Remove unused codepaths from QV8SequenceWrapperChris Adams2011-11-111-0/+5
| | | | | | | | | | | | 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>
* Include correct line number when throwing an exception from a slotAaron Kennedy2011-11-081-0/+6
| | | | | | Task-number: QTBUG-20344 Change-Id: I25be1520b55ce13d4e1c75e06effa1dee8530a7a Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Skip the captured properties step in bindingsAaron Kennedy2011-11-042-0/+11
| | | | | | | | | | Objects and notifiers in the capturedProperties list were not guarded which can lead to crashes if they're deleted prior to the binding completing. Now the notifiers are connected to and guarded immediately to prevent this. Change-Id: I912e323c52bf6169fb5077e552d5d38d9aa7faec Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Add support for more sequence typesChris Adams2011-11-0211-0/+692
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Readonly QML property supportAaron Kennedy2011-10-261-0/+45
| | | | | | Task-number: QTBUG-15257 Change-Id: I539b6e6a9e0e0172b68e8002aaa3f7c7e6648769 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add test for bug with typeof in imported js files.Michael Brasser2011-10-262-0/+51
| | | | | | Task-number: QTBUG-21864 Change-Id: I0fc9dc02f7ec00a2f7234484f5afafbbfe7ffca0 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix "for (... in ...)" loops for list properties.Michael Brasser2011-10-261-0/+13
| | | | | | | Task-number: QTBUG-22276 Change-Id: Ibe5a1180044d8e4a6ca6458e8170dd027885ad10 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Simplify expression guard logicAaron Kennedy2011-10-181-0/+6
| | | | | | Change-Id: I7d191bc8786452c5a1f14d024ff62d223adebd8b Reviewed-by: Martin Jones <martin.jones@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add JavaScript "var" property type to QMLChris Adams2011-10-0633-16/+637
| | | | | | | | | | | This commit adds a new syntax which allows "var" type properties which can have JavaScript objects (as well as other basic types) assigned to them. Such JavaScript objects cannot be bound to. Task-number: QMLNG-18 Change-Id: If7f5045f4669e0d5c1b8d0891ed765128d0bc1c6 Reviewed-on: http://codereview.qt-project.org/1466 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Allow .pragma library scripts to import other scriptsChris Adams2011-10-044-0/+34
| | | | | | | | | | | | | | | | | | | Previously, a .pragma library script would have a new context which did not have an engine set. If the script then imported other scripts a crash would occur due to dereferencing the (null) engine ptr. This commit ensures that even if no parent context is used (eg, for shared scripts which don't import the parent context) the engine from the parent context is used as the engine in the new context. Finally, unit tests for the .pragma library import with imports cases were added to tst_qdeclarativeecmascript. Task-number: QTBUG-21620 Change-Id: I671ffc9eee98a69cce7c169ce5b9d5aae4d1ff0d Reviewed-on: http://codereview.qt-project.org/5421 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Modify JS Object to QVariant conversionChris Adams2011-09-301-0/+16
| | | | | | | | | | | | | | | | | Previously, JS Objects would be converted to a QVariantMap where each value in the map was a QVariant from toVariant(propertyValue). Unfortunately, this would result in a crash if the object had a reference to another object which had a reference to the original object, due to the circular reference. This commit changes the conversion code to use QV8Engine::variantMapFromJS() instead, which avoids cyclic references. Task-number: QTBUG-21626 Change-Id: I129048c8704ae0d1095a02d0ce4c0fe5850b1b20 Reviewed-on: http://codereview.qt-project.org/5490 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Ensure JS-owned QObjects are cleaned up on v8engine dtorChris Adams2011-09-301-0/+20
| | | | | | | | | | | | | This commit ensures that the garbage collector is invoked during engine destruction. This commit also adds a unit test which ensures that the JS GC destroys JS-owned C++ objects correctly when the QDeclarativeEngine is destroyed. Task-number: QTBUG-20377 Change-Id: I2de1f2dfd1e60cc2f76abb523b99bf169d2a5a13 Reviewed-on: http://codereview.qt-project.org/3285 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix crash in String.arg()Chris Adams2011-09-281-0/+49
| | | | | | | | | | | | This commit ensures that the String.arg() function works correctly, by registering an anonymous function with the String Prototype object which calls the StringArg function, ensuring that the "this" object is valid (and passing the string as an argument to StringArg instead). Change-Id: I0a8cbaa12b39beb03a237c3ab62c6e21fafdedbf Reviewed-on: http://codereview.qt-project.org/4385 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Unwrap QJSValue from QVariant in QV8Engine::fromVariantJędrzej Nowacki2011-09-191-0/+12
| | | | | | | | | | | | | | | | | | When QML tries to unwrap real value from a QVariant and the value is a QJSValue instance, then no conversion is needed, QJSValue already contains a v8 handle. This patch, for example, solves a problem of emitting QJSValue instance in a signal that has QVariant as an argument. The QJSValue can be unwrapped and used as a normal JS value in a connected slot. This feature may be used also in a plugin model that stores QJSValues internally. Then the model in data() function can return a QJSValue which would be understood by QML. Change-Id: I1d5ede40ce2637123b09839fd848b27ad3af3dda Reviewed-on: http://codereview.qt-project.org/4451 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Fix automatic semicolon insertion.Roberto Raggi2011-09-191-0/+11
| | | | | | | | | | The parser should insert a T_SEMICOLON token when it reaches an error state and the lookahead token is following a closing brace. Change-Id: Ib849e7fbfe50c2a3e679ae0794f5780cc0b94de5 Reviewed-on: http://codereview.qt-project.org/4896 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix QDeclarativeListProperty assignmentChris Adams2011-09-191-0/+20
| | | | | | | | | | | | | This commit ensures that a QDeclarativeListReference can be assigned to another QDeclarativeListProperty, by retrieving each element in the list reference and converting to the appropriate type before appending to the target list property. Task-number: QTBUG-16316 Change-Id: Id8858058f052a53bf43eadc085fd278654478d77 Reviewed-on: http://codereview.qt-project.org/4388 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add garbage collector prologue callback to qv8engineChris Adams2011-09-064-0/+114
| | | | | | | | | | | This commit provides a generic way to manage persistent handles created by QML so that circular references don't cause leaks, by utilising v8's garbage collector callbacks. Change-Id: Ia898197fdf5d86b90915b835ce3e532f7d400de4 Reviewed-on: http://codereview.qt.nokia.com/3688 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Allow reference to signals using 'on' handler syntax.Michael Brasser2011-09-011-0/+60
| | | | | | | | | | | | | This will allow APIs like the following: trigger: mouseArea.onClicked However, signal handlers will not be callable from QML: mouseArea.onClicked() //throws exception Change-Id: I2ef5cb4e1f3ed4814ef590962391e1b14e3f0c43 Reviewed-on: http://codereview.qt.nokia.com/3683 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add enums support to QObject module APIsChris Adams2011-08-311-0/+8
| | | | | | | | | | | | | This commit adds support for retrieving enum values from QObject module APIs. Task-number: QTBUG-21033 Task-number: QTBUG-21056 Change-Id: Ib2bd107f3f5905e2d2d35f8a20c55045ef9bb322 Reviewed-on: http://codereview.qt.nokia.com/3291 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Implement script module api property get and setChris Adams2011-08-308-6/+45
| | | | | | | | | | | | | | This commit adds code for property get and set for script module APIs, and also splits up the module API unit tests into QObject and Script (QJSValue) parts. Related to commit: 3ee8a19f5b7142b96e2df649ea0dac444b5622a2 Task-number: QMLNG-33 Task-number: QTBUG-17318 Change-Id: I4aaf5d1cc1d4774dd0f0999f0985439e4d76f0ca Reviewed-on: http://codereview.qt.nokia.com/1472 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Honour the resettable flag of aliased propertiesChris Adams2011-08-047-0/+152
| | | | | | | | | | | | | | Previously, alias properties were not considered isResettable even if the property they alias is resettable. This commit ensures that the IsResettable flag is set for alias properties iff the aliased property is resettable, and that it is honoured during property reset operations. Task-number: QTBUG-18182 Change-Id: I9cab11923a952df72e976a48489a78b24a34314f Reviewed-on: http://codereview.qt.nokia.com/1471 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Ensure that the prototype chain is checked in property GetChris Adams2011-08-021-0/+72
| | | | | | | | | | | | | | This commit ensures that the prototype chain is checked during property Get operations on QObjects and other types in QML by returning an empty handle from the property Get interceptor if no valid property with the given name is found. Task-number: QTBUG-20336 Change-Id: I670ee211c74c0fdcb68c3f91b29fcc0ea8b55d6f Reviewed-on: http://codereview.qt.nokia.com/1477 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Mark objects from Component.createObject() as destructibleAaron Kennedy2011-07-291-0/+21
| | | | | | | Change-Id: I00a1a2b5cca80c3e2ea097690cadf21581e1356d Task-number: QTBUG-20626 Reviewed-on: http://codereview.qt.nokia.com/2367 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add .arg() for Javascript String typeCharles Yin2011-07-291-0/+16
| | | | | | | | | Change-Id: I973032189c40bfa4d5450396f5bad1a7c81ac68b Task-number:QTBUG-16734 Reviewed-by:Michael Brasser Reviewed-on: http://codereview.qt.nokia.com/2134 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Allow static alias to composite typeAaron Kennedy2011-07-253-0/+17
| | | | | | | | | Task-number: QTBUG-20200 Change-Id: I2a118dfc9ce1956e038f70049c905ec38396fe5e Reviewed-on: http://codereview.qt.nokia.com/2062 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Support better boolean conversion semanticsAaron Kennedy2011-07-251-0/+28
| | | | | | | | | Task-number: QTBUG-20242 Change-Id: Ie678f6189a8060de600b5394fbaaaef49be274c6 Reviewed-on: http://codereview.qt.nokia.com/2061 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Check objects can be passed as signal parametersAaron Kennedy2011-07-251-0/+18
| | | | | | | | | Task-number: QTBUG-12457 Change-Id: I2d78c8885e488e51364fe4f2a30bde36fa78636a Reviewed-on: http://codereview.qt.nokia.com/2057 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Correctly load flags for binding propertiesAaron Kennedy2011-07-252-0/+15
| | | | | | Change-Id: I80e79ff7de8d879f700f9f4fe96d796de0f17aff Reviewed-on: http://codereview.qt.nokia.com/2055 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Extract all QtQuick 1 elements into a separate library/plugin.Martin Jones2011-07-12131-131/+131
| | | | | | Change-Id: I41a280de2739ee08202f4be2519e5012870090f2 Reviewed-on: http://codereview.qt.nokia.com/1391 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Merge branch 'master' into v8-cleanAaron Kennedy2011-07-013-0/+11
|\ | | | | | | | | | | | | Conflicts: src/declarative/qml/qdeclarativevme.cpp Change-Id: I0bbc12c06d40c70433730cb33c4e9b461520263f
| * Fix regression against 4.7Aaron Kennedy2011-06-233-0/+11
| | | | | | | | Task-number: QTBUG-19136
* | Initial V8 integrationAaron Kennedy2011-06-063-3/+11
|/
* Support change slots for properties starting with '_'Chris Adams2011-05-235-0/+75
| | | | | | | | | | | | According to ECMA-262r3, property names may begin with a letter, underscore ('_'), dollar sign ('$'), or unicode escape sequence. We previously supported Change slots for properties only if the property name began with a letter; this patch adds support for properties which begin with one or more underscore. Task-number: QTBUG-17950 Reviewed-by: Aaron Kennedy Change-Id: I6f28bde18a38e32c2131e0990fe0f69bda36f90e
* Add unit test and documentation for module APIChris Adams2011-05-061-0/+5
| | | | | | | | | | Related to commit ae6c7a44394d4a5f943f1fc92f4de015ec7bcc96. Previously, only property access on module API was tested. This commit adds a test which calls a method on a module API. It also adds documentation for the qmlRegisterModuleApi functions. Task-number: QMLNG-33 Reviewed-by: Martin Jones
* Initial import from qtquick2.Qt by Nokia2011-04-2752-0/+705
| | | | | Branched from the monolithic repo, Qt qtquick2 branch, at commit a4a585d2ee907746682846ae6e8a48e19deef469
* Initial import from the monolithic Qt.Qt by Nokia2011-04-27157-0/+2130
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12