aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8
Commit message (Collapse)AuthorAgeFilesLines
* Prevent the root object from being garbage collected.Michael Brasser2012-03-231-2/+6
| | | | | | | | Passing the root object as a return value from a C++ function could cause the indestructible flag to be set to false. Change-Id: Ib70c666f0d0ffbb48bca1996c2517fbccafa5dc1 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix compilation on QNX.Tobias Koenig2012-03-201-0/+4
| | | | | Change-Id: I5e01cad23066a645c1434ce1463d370733f53e4f Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Make QVariant conversion for JS null type symmetricKent Hansen2012-03-203-4/+7
| | | | | | | | | | | | | | | | If you pass (void*)0 to QJSEngine::toScriptValue(), or you pass a QVariant of type QMetaType::VoidStar containing a 0 value, you get back a QJSValue of type null (isNull() returns true); that's fine. However, if you called QJSValue::toVariant() on a JS null value, you would get back an invalid QVariant. The expected result is a QVariant of type QMetaType::VoidStar containing a 0 value. This makes the conversion of the JS null type symmetric and avoids loss of data. Change-Id: Ifa6e788152118f80adf9c2d7be1283f053b44294 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Allow parent to be specified for Qt.createComponentMatthew Vogt2012-03-201-5/+32
| | | | | | | | | | | | | | Add an optional parameter to the Qt.createComponent function which allows the caller to specify the object that will become the parent for the created component. If the parent is not specified by the caller, it becomes the QML engine; this behavior will change in the near future to allow these component objects to be collected when no longer referenced. Task-number: QTBUG-24840 Change-Id: I2742133fe8ab8cbc80d8012a9d9b9fc2e4596fca Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Allow threaded compilation in an async LoaderMartin Jones2012-03-151-4/+23
| | | | | | | Enables threaded compilation for a Loader "source". Change-Id: I2d60a3ace07aab58f3b8f069e45a2864178c959f Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix crash caused by dereferencing collected v8 dataChris Adams2012-03-151-2/+7
| | | | | | | | | | | | | | | | | | If a var property of a QObject is read after the v8 data associated with the qobject has been deleted but prior to the DeferredDelete event being processed, the varProperties array will be null and a crash will occur. This patch ensures that we check for this condition in both the access and set codepaths for var properties, and also ensures that an object which has previously been queued for deletion cannot be referenced in JS. Finally, it adds a unit test to ensure that we don't regress. Task-number: QTBUG-24748 Change-Id: Idde384ca01e18f4dcf9e376e9379f2c5eb410e14 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Remove binding dependency on QQmlExpressionAaron Kennedy2012-03-153-9/+6
| | | | | | | | This is the first step to creating much lighter weight bindings that are tuned for the specific scenario in which they're used. Change-Id: Ib985dcff25679b711b5c634bbc891aa7902bf405 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Ensure that dynamic property storing QObject ptr notifies on deleteChris Adams2012-03-151-1/+1
| | | | | | | | | | | | | Previously, when a QObject ptr was stored in a dynamic variant property, the value of the property could change (to a zero ptr) if the QObject was deleted without a notify signal being emitted by the QDeclarativeVMEMetaObject which stores the property. This commit ensures that such a notify signal is emitted correctly. Task-number: QTBUG-23451 Change-Id: I5689abd984b177737f8d5f18950838b73ebde328 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Let V8 throw the exception when QML property lookup failsKent Hansen2012-03-141-12/+6
| | | | | | | | | | | | | | | | | | Only V8 knows whether a failed property lookup should actually cause a ReferenceError to be thrown. When evaluating a "typeof" expression, for example, a ReferenceError should not be thrown even if the expression involves global variables that don't exist, according to the ECMA-262 specification. QML should try to match the standard JavaScript behavior. This is achieved by simply returning an empty value handle (to signify the absence of the property), and leaving it to V8 to throw an exception as appropriate. Task-number: QTBUG-21864 Task-number: QTBUG-24448 Change-Id: I9945adcab98fc3b801371163367473d6af0ab31a Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Use the same ReferenceError message wording as V8Kent Hansen2012-03-141-2/+2
| | | | | | | | | | | Instead of "Can't find variable: foo", use "foo is not defined". This is in preparation of letting V8 throw the exception when a property lookup fails on the QML scope object (needed for QTBUG-24448). Change-Id: I3c747482a8ef138dad9a85530a4f6b5c4c818a03 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-133-63/+63
| | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I62d203f21df63a95ee236e578b10418fd9680707 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Don't grow container when desired size is knownJoão Abecasis2012-03-091-11/+14
| | | | | | | | | | | | | | | | | | | QList<Type>::reserve() is used upfront to allocate necessary memory in a one go. This tells us straight away whether allocation is possible at all and reduces re-allocations and consequent memory copies. This also has the side effect that no spare memory is allocated, also allowing up to (and including) INT_MAX elements to actually be stored in the underlying QList, as long as enough memory is available to satisfy the allocation request and subsequent fill. The qqmlecmascript::sequenceConversionIndexes was changed to not attempt INT_MAX allocations as, given enough memory and virtual address space, that might succeed but take a really long time. Change-Id: I4b0c965e9c23be78874343a70d7c155933c80903 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Compile after API changes in QCoreApplicationGunnar Sletta2012-03-071-3/+1
| | | | | Change-Id: I6bc6978a5c68503facd8085bd35e66f86af58a90 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-0519-167/+440
| | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-2457-0/+15218
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>