aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix another bug in sweeping the identifier hash tableSimon Hausmann2018-08-301-0/+58
| | | | | | | | | | | | | | | | When an identifier overflows into the next bucket and its original spot becomes free, it is not only important to move that identifier into the now free spot. It is also necessary to shift the entries in the bucket overflowed into one entry to the left, to avoid an accidental terminator in the bucket. Such a terminator can make entire strings disappear from the hash table. That in turn may result in repeated insertion of strings that are otherwise identical, leading to internalClass lookups failing (despite the members existing) after a GC. Task-number: QTBUG-70205 Change-Id: Idf931287896a8ff730af98d36de703157e9792d3 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* A reference to a super property can have side effectsLars Knoll2018-08-291-7/+0
| | | | | Change-Id: Iaf33e4ac3412f8b2e02058f77193938690733f24 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Throw a type error if the super class is not a constructorLars Knoll2018-08-291-2/+0
| | | | | Change-Id: I1cf83c73ea1b628f44845e1b9ea324d3e069c344 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Pass the correct new.target to super callsLars Knoll2018-08-291-3/+0
| | | | | Change-Id: I648e173a156ffd47564192ecdcb81a03281fdcb4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Initialize this to empty for derived constructorsLars Knoll2018-08-291-1/+0
| | | | | | | | | As per spec, this should be uninitialized in derived constructors, and the base constructor needs to get called exactly once. Change-Id: If31804e58d7ba62efde8fbf6cd852674f8da4495 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix TDZ check for referencesLars Knoll2018-08-291-0/+14
| | | | | | | | | | So far we've not been doing the TDZ check for expressions such as x.name, a[x] and super[x] correctly. Fix this by adding a second boolean that states whether a tdz check for the subscript is required and use the first boolean to check the base of these references. Change-Id: I658cd5b69f001fbdc714f252914ad9749734f027 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix remaining test failures for Array.isArrayLars Knoll2018-08-291-2/+0
| | | | | Change-Id: I6258cae2933392c260ce4c4d7f90a2838d91cd51 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix handling of uninitialized exports when iterating module namespace objectsSimon Hausmann2018-08-291-2/+0
| | | | | | | | | | | | | | | | | | | | We must throw reference errors when the iteration reaches an uninitialized export. As with other module namespace cases we don't know at the call site that we're dealing with this special object, we must throw the reference error inside the iterator. That brings in the additional complexity that we can use the iterator to get a list of all names (should not throw) as well as to retrieve the values (throw on uninit). We make the distinction inside the ::next() function based on whether a Property pointer was provided, which requires slightly different variants inside the ObjectIterator that uses the internal iterator. On the upside this avoids value copying when they would be unused otherwise. Change-Id: Iac45d0ed39bea861ea92db875821225c0feb9391 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix dead temporal zone checking in module namespacesSimon Hausmann2018-08-291-5/+0
| | | | | | | | | | | | | | | Accessing uninitialized imports through the module namespace object should throw a reference error. Unfortunately we can't do this check on the caller side of the namespace object get, as we have no idea that we're talking to one. Therefore we must throw in the vtable methods. When checking via Reflect.has(), the properties should be reported as existing. This means providing a virtual hasProperty() in the module as well as changing Reflect::method_has to use the vtable method instead of doing a get (which would throw). Change-Id: Ic0ec51de3832c6a67044fc8f689ac534f349c1b6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix scoping of the default exportSimon Hausmann2018-08-291-3/+0
| | | | | | | | Default export variables should follow lexical scope and live therefore in the dead temporal zone (15.2.3.8). Change-Id: I959a1dc1cdd430825d6d207138efaef23394bd04 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Optimize access to lexically scoped variablesSimon Hausmann2018-08-292-186/+62
| | | | | | | | | | | | | If we access a lexically scoped variable after the initializer, then we know it's either initialized or at least undefined, so we don't need to do the TDZ check anymore. The ES tests ensure that we don't optimize too much and the newly revived tst_v4misc test ensures that we do not generate the TDZ check instruction for certain scenarios. Change-Id: I6706d1feb22217f323124ee698ebadb70324693b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix most issues with Map.prototype.forEachLars Knoll2018-08-281-5/+0
| | | | | Change-Id: I730f00c6fc2a5f2275b92b09994f6e27dc6a3da4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Map and WeakMap constructorLars Knoll2018-08-281-23/+0
| | | | | Change-Id: I52c31a006b80430ea949eaac246301e51a430f89 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for WeakSetLars Knoll2018-08-282-81/+1
| | | | | Change-Id: I5cee2bf0c6a45ad2c14b52e1a4fc5ef015e01042 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement support for WeakMapLars Knoll2018-08-282-90/+1
| | | | | Change-Id: Id23e80fe5918ba7dc897568123bf3db4d35e9092 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement the dead temporal zoneSimon Hausmann2018-08-281-57/+0
| | | | | | | | | | | | | | With const and let it is possible to access the declared member before initialization. This is expected to throw a type reference error at run-time. We initialize such variables with the empty value when entering their scope and check upon access for that. For locals we place the lexically scoped variables at the end. For register allocated lexical variables we group them into one batch and remember the index/size. Change-Id: Icb493ee0de0525bb682e1bc58981a4dfd33f750e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickTableView: handle RebuildOption::ViewportOnlyRichard Moe Gustavsen2018-08-271-0/+54
| | | | | | | | | | | When rebuildOptions have ViewportOnly set, we now let the top-left item be the same as before (and at the same position as before), and start rebuilding from there. This will greatly increase performance if e.g the table has been flicked far down to row 1000 when the rebuild needs to happen (e.g because the model got a new row). Change-Id: I30beb34a7beccedff8dc406f9a524119a2893eb3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTableView: only preload to pool if reuseItems is trueRichard Moe Gustavsen2018-08-271-4/+19
| | | | | | | | We move preloaded items into the pool. But this is pointless if we're not reusing items in the first place. Change-Id: I2274b0d29c98162da5fa4859c810c42093875836 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Implement most remaining methods of AtomicsLars Knoll2018-08-261-2/+0
| | | | | | | The only missing ones now are wait() and wake(). Change-Id: I2c0ee78cdd8a249e0e841861dd4b76c4665b0ae0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Partial Atomics supportLars Knoll2018-08-262-61/+1
| | | | | | | | | | Implement support for basic atomic operations on SharedArrayBuffers. Half of the methods still need a proper implementation. Change-Id: Ia88da358e0c2ae6d28e9bcc1feb8980b6f51a812 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement support for SharedArrayBufferLars Knoll2018-08-252-52/+1
| | | | | | | | We'll still need to hook this up with Worker threads to become useful. Change-Id: Iedae7307edd76368aeba163731856ebe9b32c6b6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement support for call/callAsConstructor in Proxy objectsLars Knoll2018-08-231-18/+0
| | | | | | | | | | | This adds the last missing piece of functionality for Proxy objects. Also fix a bug where we ignored the newTarget in Reflect.construct. Change-Id: I2443470f2ca13fb6223768c3bf6bdc3766bb4fc3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement IsConstructor for Function objectsLars Knoll2018-08-231-2/+0
| | | | | | | | Use the jsConstruct member in the function object for this and set it to a nullptr for methods that are not a constructor. Change-Id: I63d2971b23b2596a8e3b6d2781f0d9ed3208693b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Prevent ListView from jumping horizontally with flick(0,<number>)Michael Brasser2018-08-232-0/+37
| | | | | | | | The internal flick functions were not written to handle empty flicks in invalid directions. Guard our calls accordingly. Change-Id: I34801a7e548160ce4895dd8a2f6c0b17172cd02e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: don't overwrite rebuildStateRichard Moe Gustavsen2018-08-233-0/+131
| | | | | | | | | | Since it's fully possible to end up calling invalidateTable() while in the process of rebuilding the table, we need to ensure that we don't mess with the current rebuildState. Instead, just schedule that we need to rebuild once more later. Change-Id: If27bb14f0bc9f72c53eb47e6115d7ad580cdb516 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add a HoverHandler autotestShawn Rutledge2018-08-234-3/+416
| | | | | Change-Id: I223bad4f8117af76ad2a5079ecc0b73c2eba94bc Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix some remaining issues with detaching of array buffersLars Knoll2018-08-231-2/+0
| | | | | | | | | | Make sure we check for detached buffers after all other calls that could execute code have happened. To do that convert the values to numbers before calling the write() methods of the specific typed array. Change-Id: I091e41400f740dfc1d0826657e285443c9336c40 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement %TypedArray%.prototype.sliceLars Knoll2018-08-231-29/+0
| | | | | Change-Id: I50bce4ad50f27a67e53396c5283ccc84acbb8321 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement %TypedArray%.prototype.mapLars Knoll2018-08-231-22/+0
| | | | | Change-Id: Ifd2e4585cd3b9fedf2a2a4573c4f3ea68e0257fb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement %TypedArray%.prototype.filterLars Knoll2018-08-231-32/+0
| | | | | Change-Id: I37bd3ab43f2d896b62fb9afc74e5fe3313b591d2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix %TypedArray%.prototype.subarrayLars Knoll2018-08-231-10/+0
| | | | | Change-Id: I1b199111c55987434645276abfc47a254babc35a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix toLocaleString implementations in (Typed)Array.prototypeLars Knoll2018-08-231-13/+0
| | | | | Change-Id: Idcabd68b1651ad3cae315a16cb0e1361cba21253 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement a couple of methods of TypedArray.prototypeLars Knoll2018-08-231-214/+0
| | | | | | | | Implement the methods that are equivalent to the methods in Array objects. Change-Id: I22d7eeaebd7630bae26507f7d763a11845a09e31 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement TypedArray.prototype.copyWithinLars Knoll2018-08-231-25/+0
| | | | | Change-Id: If0d33cc40e79d0609ad205cfe5a08d2266403867 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a couple of test failures for detached buffersLars Knoll2018-08-231-6/+0
| | | | | Change-Id: I76308d4699f212758274b75ea1328e7f6a6c6be8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement %TypedArray%.ofLars Knoll2018-08-231-11/+0
| | | | | Change-Id: Icad9c1bedef83be8c6124ca3456a57d528c18733 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix name property of %TypedArray% objectLars Knoll2018-08-231-1/+0
| | | | | Change-Id: Ic0d46afe1ce6c57a839803dc8defccec6b3ddfc8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix DataView constructor to be spec compliantLars Knoll2018-08-232-4/+0
| | | | | Change-Id: I312f8e086b733e184b353d77452f5d4a1262469a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix test failures in DataView.prototype methodsLars Knoll2018-08-231-82/+0
| | | | | Change-Id: Ib9a32f9993c6768c6a55f3192a4f3a8ef05eda8f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix DataView constructorLars Knoll2018-08-231-1/+0
| | | | | Change-Id: I5d2eebd7bb0424462f844922b7168a30f5ca66cb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix bugs in ArrayBuffer.prototype.sliceLars Knoll2018-08-231-17/+0
| | | | | Change-Id: I6de8031a04c372a5309a878811da55b93b53da3d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlDelegateModelItem: ensure that we emit changes to row and columnRichard Moe Gustavsen2018-08-222-0/+123
| | | | | | | | | | | | | As it stood, we would only emit changes to row and column if index changed as well. But when removing rows and columns from the model, it can happen that we reuse an item that by accident has the same index as the one we change it to, but belonging to a different row and column. So we need to check for changes to the index the same way we do for row and column. Change-Id: I9d507a74aa5dcb0fe7630e7af1e949bd2db7fb47 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: drain pool upon setting reuseItems to falseRichard Moe Gustavsen2018-08-221-0/+19
| | | | | | | | | | As (soon to be) documented, drain the pool immediately when setting reuseItems to false. This will give developers a way to clear the pool if e.g running low on memory. Besides, there is no reason to keep items in the pool if we're not reusing them. Change-Id: I49f0283721a63c6a6b92631f00c7ad711a262978 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Ensure that SinglePointHandler handles touch pointsShawn Rutledge2018-08-221-0/+54
| | | | | | | | | | | A QQuickPointerTouchEvent's button and buttons properties are not currently set (although we had some uncertainty in the past about whether it would be appropriate for a touch press to simulate a left button press). So it seems that f2ba3bd9792500b4d3fcfd23b03098a32641ef4f broke the behavior of PointHandler on touchscreens. Change-Id: I890cc9889e847636c8f385753e47a078ec582195 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* MultiPointHandler: ensure centroid properties are reset after releaseShawn Rutledge2018-08-221-0/+19
| | | | | | | | | | | ...and verify the centroid changes in the DragHandler autotest. It was observable in manual tests that draw velocity vectors that they weren't getting reset to zero after the release, after ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2. Change-Id: I16186d36d51a567b0d653307421147264a5e6326 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QQuickTableView: move TableView from Qt.labs to QtQuickRichard Moe Gustavsen2018-08-2213-13/+0
| | | | | | | | | | | TableView is now ready for Qt-5.12. The only thing missing is documentation, which is currently being written, and on the way. So remove the temporary labs plugin that used to register TableView, and register it together with the other QtQuick items. Change-Id: I7f360eac3934d228904a4133363e336afe0c451a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTableView: check if the providers are undefined, not nullRichard Moe Gustavsen2018-08-211-2/+2
| | | | | | | | | | | | Checking if QJSValue isNull() will just check if it contains the js value "null". But we want to check if the application has assigned anything at all to the providers. Any value other than a function will not be accepted (which we check for at the time we try to call them (from resolveColumnWidth() and resolveColumnHeight()). Change-Id: I24717b67e99dd1ad6684a83125d2a4c7826dd501 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Provide option to skip registration of enum classes unscopedRainer Keller2018-08-214-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enums classes are registered unscoped which leads to clashes in the following cases: 1. Two different enums contain the same values 2. The name of an enum class is the same as an enum value In the 2nd case you can not even access the scoped enum at all because it will be overwritten by the primitive type. Users can now add a class info to the meta type to disable the unscoped registration which solves all clashes. The default is kept as is. class MyClass : public QObject { Q_OBJECT Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") public: ... }; [ChangeLog][QtQml] Added option to disable unscoped registration of enum classes. Change-Id: Ifa4197a14a252575e8a25ae56fb6ee479addf80b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTableView: set the stacking order of delegate items to 1Richard Moe Gustavsen2018-08-211-0/+1
| | | | | | | | | Let all delegate items have a stackin order (z) equal to 1. This is how ListView does it, so do the same in TableView to make them behave as similar as possible. Change-Id: I5d4629e8b116cd62c84e4fe9aefdb087e3c6e325 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add support for ECMASCript modules in WorkerScript elementsSimon Hausmann2018-08-213-8/+23
| | | | | | | | | Similar to script imports from .qml files, the .mjs extension is used to distinguish between ES modules and plain script files. Change-Id: Id5f9b59fb77e99e3c9d6a404e6d091d96b501ad6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>