aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qjsvalue_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-195/+0
| | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove QJSValue::propertyFlags() functionKent Hansen2012-02-021-2/+11
| | | | | | | | | | | | | | | | Rationale: The API is incomplete. There is no way to set/update the flags; adding a third (optional) argument to setProperty() is ugly. If necessary, a QJSPropertyDescriptor API should be added, to enable complete setting/querying of properties. The flags were moved to QJSValuePrivate, and the propertyFlags() implementation kept, because there is one place the read-only flag is checked internally (in qv8typewrapper). Task-number: QTBUG-23604 Change-Id: I089dce28dbda428662aac7c8d1536987fe6d855c Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove invalid QJSValue typeKent Hansen2012-02-021-5/+2
| | | | | | | | | | | | | | | | | | | Rationale: It's confusing to have an invalid type (which doesn't exist in JavaScript), and it creates lots of extra cases that have to be handled e.g. in value conversion and comparison. The Undefined type should be sufficient. Also, the invalid value type was being (ab)used to 1) make setProperty() act as a property deleter, and 2) signify that a property queried by property() doesn't exist. The recently introduced functions has(Own)Property() and deleteProperty() now provide that functionality. Default-constructed QJSValues now have the Undefined type. Task-number: QTBUG-23604 Change-Id: I1847492724d31e03ee1212c09ec87a2010920dc5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove QJSValue::instanceOf() functionKent Hansen2012-02-011-2/+0
| | | | | | | | | | | | | Rationale: This is a remnant from QtScript. There is no good reason for providing this type of low-level "prototype inheritance chain" checks in this high-level QJSValue class. If you want to check if an object is of the "right type", you can check if it has the properties you require using property(). Task-number: QTBUG-23604 Change-Id: I3a274212cc57c38228fab73423af481e1b95d8a5 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QJS{Engine,Value}: Remove QRegExp-specific functionsKent Hansen2012-02-011-1/+0
| | | | | | | | | | | | | Rationale: QRegExp regular expressions have different semantics than JavaScript RegExp. This can cause data loss and unexpected behavior. qjsvalue_cast() and fromScriptValue() can still be used to convert between QRegExp and JS RegExp. Task-number: QTBUG-23604 Change-Id: Iacf4aaea232aff9e4cecf4afa40753229bc5d643 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove QJSEngine::toObject() and QJSValue::toObject()Kent Hansen2012-02-011-2/+0
| | | | | | | | | | Rationale: There is no compelling usecase for these functions. They are a remnant from QtScript. Task-number: QTBUG-23604 Change-Id: I6d8b4299956dd8f6284934739c4f1a65e4deb64c Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-2/+2
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Add QJSValue::callAsConstructor() functionKent Hansen2012-01-201-3/+3
| | | | | | | | | | The old name, construct(), was bad. This name is more descriptive and consistent with the other callXXX() functions. Task-number: QTBUG-23604 Change-Id: Ie205b0c52721782101e665f7dfedcac9051a00d0 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::hasProperty() and hasOwnProperty() functionsKent Hansen2012-01-201-0/+2
| | | | | | | | | | These functions provide a way of querying whether a property exists, without relying on the QJSValue invalid type (which will be removed). Task-number: QTBUG-23604 Change-Id: I2efd53a1e54cc202ecc022d12730b2775384cf53 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Replace QScriptBagContainer by QIntrusiveListKent Hansen2011-08-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | QIntrusiveList effectively does the same as QScriptBagContainer, without the need to inherit a Node class. Let's avoid the code duplication. However, QIntrusiveList::remove() and insert() are less strict than QScriptBagContainer; introduce QScriptIntrusiveList that performs the same sanity checks (no duplicate insertion, etc). Ideally these checks would be merged into QIntrusiveList. Also rename QJSValuePrivate::reinitialize() to invalidate(), and make it not call engine->unregisterValue(this) any more. Values are only invalidated at engine destruction time, and it's the engine's responsibility to erase the list. Change-Id: I60fc61ee8f90a716a285b1dd1bf4d6a08a9349df Reviewed-on: http://codereview.qt.nokia.com/2628 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove dead code from QJSValuePrivateKent Hansen2011-08-041-1/+0
| | | | | | | | | | | reinitialize() was used to implement setGlobalObject() and setScriptClass() in the QtScript/V8 port, but those functions will not be part of the new JS API. Change-Id: I030d371659136a407636c7a13afe7623a60a2837 Reviewed-on: http://codereview.qt.nokia.com/2623 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Move QJSValue InvalidValue definition to "inline" headerKent Hansen2011-08-041-24/+0
| | | | | | | | | | | Avoid warning "inline function ‘QJSValuePrivate::QJSValuePrivate()’ used but never defined" when only qjsvalue_p.h is included for a compilation unit. Change-Id: I75bb49dedbfcedf5f71c25210371f03663572b46 Reviewed-on: http://codereview.qt.nokia.com/2620 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Improve QJSValueIterator implementation.Jedrzej Nowacki2011-08-031-0/+2
| | | | | | | | | | | The old implementation was a hack, it had some memory leak (in case of deleted engine) and performance problems (for example all names were copied to separate QList instance instead of reusing v8::Array). Change-Id: Ic70ad511127a8c05df3c627e4496083004c6452a Reviewed-on: http://codereview.qt.nokia.com/2512 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Merge the QJSEngine and QJSValue development branch into master.Simon Hausmann2011-07-291-0/+213
This replaces the dependency to QtScript with two new builtin classes QJSValue and QJSEngine. This is still work in progress, development continues now in the master branch. Change-Id: I7f5487feb45c972f25a22b10cc81b9218b9805de Reviewed-on: http://codereview.qt.nokia.com/2299 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>