aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qjsvalue.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-142/+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>
* Mark constructor of QJSValue as deletable.Jędrzej Nowacki2012-02-071-1/+2
| | | | | | | This constructor is there only to force compile time error. Change-Id: Ia2e059e0c7fa516949a166da8856543a5608d217 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove QJSValue::isFunction() functionKent Hansen2012-02-021-2/+0
| | | | | | | | | | Rationale: QJSValue::isCallable() should be used instead. There is no compelling reason to be able to distinguish between JS Function instances and other callable objects. Task-number: QTBUG-23604 Change-Id: Ieef6b32030ef70f54081035fd4ffc3c17c184cd3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove QJSValue::construct() and deprecated call() overloadKent Hansen2012-02-021-5/+1
| | | | | | | | callAsConstructor() should be used instead. Task-number: QTBUG-23604 Change-Id: If95ab9906712ede7cbae5e9d24624708bccf880f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove QJSValue::toInt32() and toUInt32() functionsKent Hansen2012-02-021-2/+0
| | | | | | | | toInt() and toUInt() should be used instead. Task-number: QTBUG-23604 Change-Id: Ib64aea139e9082066a1e5096ef9fe3a97c35d3eb Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove QJSValue constructors that take QJSEngine argumentKent Hansen2012-02-021-12/+0
| | | | | | | | | | | Rationale: These were remnants from QtScript. The difference from the standard constructors is that the value is eagerly bound to the engine, so they can be a bit faster. But they are also more low-level and look ugly in use. Task-number: QTBUG-23604 Change-Id: I5dae7452389383f60055d5ccc4f28d53c52f6092 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove QJSValue::propertyFlags() functionKent Hansen2012-02-021-15/+0
| | | | | | | | | | | | | | | | 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-3/+1
| | | | | | | | | | | | | | | | | | | 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-2/+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 QJSValue::toUInt16() functionKent Hansen2012-02-011-1/+0
| | | | | | | | | | | Rationale: Remnant from QtScript. The implementation is just zeroing the upper 16 bits of the 32-bit integer conversion. Task-number: QTBUG-23604 Change-Id: I6b4b40883da01713d2a946eb028264f3a351276b Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove QJSValue::toInteger() functionKent Hansen2012-02-011-1/+0
| | | | | | | | | | | | Rationale: This is a remnant from QtScript. A function called toInteger() that returns a double looks strange. Use toInt32() to convert a QJSValue to an integer. Task-number: QTBUG-23604 Change-Id: I2829704c64b077fca264b660c46248c3f35cb5c0 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-1/+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>
* Mark deprecated functions in QJSEngine and QJSValueKent Hansen2012-01-201-21/+33
| | | | | | | | | | | | | This functionality will be removed or renamed in the final Qt 5 API. From this commit and with deprecated warnings enabled (DEFINES += QT_DEPRECATED_WARNINGS), it's easy to see how existing users of this API (e.g. qtjsondb) are affected. Task-number: QTBUG-23604 Change-Id: I242c43377bb34ddcca84b6ed5b7ef9fbf2017a83 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::callAsConstructor() functionKent Hansen2012-01-201-0/+1
| | | | | | | | | | 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::callWithInstance() functionKent Hansen2012-01-201-0/+1
| | | | | | | | | | | | | | With the deprecated call() overload, it was confusing what the first argument was (the this-object or an actual argument passed to the function). Introduce a dedicated function for the "explicit this-object" case. This makes code more readable, and eliminates the need to pass a "dummy" this-object to call() in the quite common case where you don't care about the this-object. Task-number: QTBUG-23604 Change-Id: I18f8be6592a848436351516bea266fc7e9195777 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::call() overloadKent Hansen2012-01-201-0/+1
| | | | | | | | | | | | This overload takes only an argument list, not a this-object, since that is a very common way of calling stand-alone ("non-member") functions. Now there is no longer a need to pass a dummy value for the this-object. Task-number: QTBUG-23604 Change-Id: Iae952d91fce5bcaa62a05b9978c15f32802da90a Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::isCallable() functionKent Hansen2012-01-201-0/+1
| | | | | | | | | | | This replaces the isFunction() function. isFunction() will be removed. It's possible that objects are callable even if they aren't Function instances. Also, "isCallable" is consistent with call(). Task-number: QTBUG-23604 Change-Id: I42e0ab2ad9dc84e7793199254bbd89d5c9466e6a Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::toInt() and toUInt()Kent Hansen2012-01-201-0/+2
| | | | | | | | | | These replace toInt32() and toUInt32(), which are obsolete and will be removed. Task-number: QTBUG-23604 Change-Id: I83c055dbbe399fa7242889cee8a177440a693d9a Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::deleteProperty() functionKent Hansen2012-01-201-0/+2
| | | | | | | | | | | This makes it possible to delete a property without relying on passing a QJSValue of invalid type to setProperty() (the invalid type is going to be removed). Task-number: QTBUG-23604 Change-Id: I653b3349050ad1aac1cf6ccc8547c753abbb9f1d 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/+3
| | | | | | | | | | 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>
* Remove the use of QT_MODULE()Gunnar Sletta2012-01-201-1/+0
| | | | | Change-Id: I1c07231b0bf412fe490a44b9a060bb2e2ef11154 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove obsolete toBoolean() and isBoolean() QJSValue gettersSimon Hausmann2012-01-111-2/+0
| | | | | | | We should use "toBool" and "isBool" for consistency with QVariant. Change-Id: I266f2a36a034a5b323e614777ceacbc0d2ffec16 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>
* Use the correct export macrosLars Knoll2011-08-111-2/+2
| | | | | | | | | | Otherwise we'll get problems when compiling on Windows. Change-Id: I2a366da3cd4cd08ba8bc8d9c8c81409737bee697 Reviewed-on: http://codereview.qt.nokia.com/2752 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Merge the QJSEngine and QJSValue development branch into master.Simon Hausmann2011-07-291-0/+165
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>