aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/ecmascripttests
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a small bug in virtualHasPropertyLars Knoll2018-09-091-1/+0
| | | | | | | | | It should call hasProperty() on the proto if the property wasn't found locally, instead of looping and calling getOwnProperty, as this leads to subtly differences with Proxy objects. Change-Id: I088b0522c621999b7991f9194f46eaa9f6e15206 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Include symbols in getOwnPropertyKeysLars Knoll2018-09-091-2/+0
| | | | | | | And fix getOwnPropertySymbols and getOwnPropertyDescriptors. Change-Id: Ie0e4c3d308ffe8a904e9a6ab9242b2cda59d779f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Proxy.revokable creates an object with an anonymous revoke functionLars Knoll2018-09-091-1/+0
| | | | | Change-Id: Iaed36da1284e6545a88eaa17d23fa2862fc611be Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix ownKey iteration over Proxy objectsLars Knoll2018-09-091-4/+0
| | | | | Change-Id: I045a4844c06df9232cc8b04485ab0a39bb990e3f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix some bugs in Proxy::virtualGetOwnPropertyLars Knoll2018-09-081-3/+0
| | | | | Change-Id: I28c32f2bfdac8848baf82905fb04790f29451805 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix spec compliance of Object::virtualGet()Lars Knoll2018-09-081-1/+0
| | | | | Change-Id: I9c07a6b08e9029b893c28e7a945f839c0f0dda8d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Skip all realm related testsLars Knoll2018-09-082-105/+14
| | | | | | | | We don't support realms currently, and it's unclear whether we'll ever need the support. Change-Id: I023f84d477f374b3cef2590a78542c0c9408a144 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement IsCompatiblePropertyDescriptor and use it in ProxyLars Knoll2018-09-081-3/+0
| | | | | Change-Id: I40bc5ce2858ebfe1afb04a7957a53114b37ef50f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix toNumber conversions for hex, octal and binary stringsLars Knoll2018-09-081-3/+0
| | | | | Change-Id: Ifb7159a3307c96b27530e001ab13bcd6ddd03d09 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix test failures in NumberLars Knoll2018-09-081-9/+0
| | | | | Change-Id: I0743e9d7fdda0be7a8bb4f9fe3b8e195722c1c90 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a corner case in Math.max()Lars Knoll2018-09-071-1/+0
| | | | | Change-Id: I9dffaec95b01757fb21466617d055def2edeeb30 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Date.Utc()Lars Knoll2018-09-071-6/+0
| | | | | Change-Id: Iefba82adbf8f7b944079d165054e9dfe4461ac77 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't evaluate the switch expression inside the switch blockLars Knoll2018-09-071-2/+0
| | | | | Change-Id: I6cbe0610b65c9f9d7381bc1c70ae17e10486d5c3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a smaller bug in IteratorCloseLars Knoll2018-09-071-1/+0
| | | | | | | Throw the correct error in all cases Change-Id: Ic8f146cf13db605cb54cb8c96aaf0b3a1b9cca96 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for yield*Lars Knoll2018-09-071-45/+0
| | | | | Change-Id: I5b054b59519ed825459a5b0b0a7cd2c6fc8a3797 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Throw a type error when trying to destructure null or undefinedLars Knoll2018-09-071-4/+0
| | | | | Change-Id: Id1bba1a729124bccb8a90dcf40252fe5c69d27a3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix exception handling while destructuringLars Knoll2018-09-071-12/+0
| | | | | | | | | | | | | | | When an exception happens during destructuring, IteratorClose needs to be called, unless the exception happened inside the IteratorNext call (in that case the iterator is assumed to be invalid and we shouldn't call close on it). Implement this, by ensuring that we set the done return variable of IteratorNext to true whenever IteratorNext throws an exception. IteratorClose will check the done state and not do anything in that case. Change-Id: I73a27f855f2c4d3134b8cc8980e64bf797d03886 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Some fixes when unwinding inside for-of loopsLars Knoll2018-09-071-8/+2
| | | | | | | | This is not perfect yet, as the two regressions in TestExpectations show, but it's an improvement over the current situation. Change-Id: I82c0ef0f69619562037c573bea1026abc53c1ab3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix new.target access from eval()Lars Knoll2018-09-071-3/+0
| | | | | Change-Id: I1855eb303225d1784b019f8eebab0ad8bf2cdf5e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* fix accesses to this in arrow functionsLars Knoll2018-09-051-4/+0
| | | | | Change-Id: I4c0cfc3a120fc0b246760886b576e92d3f7623ff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a couple of internals in TypedArraysLars Knoll2018-09-041-15/+0
| | | | | | | | Handle property keys that are numeric strings, and implement getOwnProperty. Change-Id: I4c7ed21b6429b07f02a28bce537bcb7934a993d3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement defineOwnProperty for TypedArraysLars Knoll2018-09-041-9/+0
| | | | | Change-Id: I2e7aa05a340d54e2f34ec4e59a69f3ce66be75d9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix subclassing of ArrayBuffer and TypedArraysLars Knoll2018-09-041-8/+0
| | | | | Change-Id: I481974c224f7fdb4df6b641e8dd550add96b4c08 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Throw a reference error if the super constructor is not calledLars Knoll2018-09-041-24/+0
| | | | | | | And return the correct this object from the subclass constructor. Change-Id: I8d68f07c3080f8c5ff8b10ad2cc85e017bf710d8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Arrow and generator functions don't have a prototype propertyLars Knoll2018-09-041-1/+0
| | | | | Change-Id: Icbc25f1f723fe45a8c265f1b4bdf5f3fad3c4775 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Member functions should not have a prototype propertyLars Knoll2018-09-041-6/+0
| | | | | Change-Id: I19eb4012c8fee51a7e5bf264d11ab5337ac2a88d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't define a prototype property for most functionsLars Knoll2018-09-041-16/+0
| | | | | | | | Only functions that are constructors should have a prototype property. Change-Id: Ifcf6f8b6c38de055d871d57ada38a23432974263 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Always generate a context if an inner function uses superLars Knoll2018-09-041-6/+0
| | | | | Change-Id: I4215c215a28da6855d946dec8727c0c4f0acb933 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix accessing of arguments inside eval and arrow functionsLars Knoll2018-09-041-1/+0
| | | | | Change-Id: I1df6389a1fa6f1c3fc257df3075cea0c0af6a9cf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Throw type error if this is uninitialized when accessing superLars Knoll2018-08-311-2/+0
| | | | | Change-Id: I028e198d46a2ec1c55f5dd4cce8dd868ed3e8202 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix thisObject when calling super propertiesLars Knoll2018-08-311-4/+0
| | | | | Change-Id: Ia520d43ea2c29c16cfc8ffc86a32187a78848502 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix super property accessLars Knoll2018-08-311-1/+0
| | | | | | | | | Super properties work in a rather special way by accessing a 'home object' on the function object, and reading from it's prototype. Change-Id: I666334c9c27048c6c2ba6770dd8c9f56aecbee14 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix internalPutLars Knoll2018-08-311-14/+1
| | | | | | | Fix spec compliancy of the put() method. Change-Id: Iab4f4040cc7308d0c8d9f2eed239af98b7c2eee2 Reviewed-by: Simon Hausmann <simon.hausmann@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 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>
* 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-281-81/+0
| | | | | Change-Id: I5cee2bf0c6a45ad2c14b52e1a4fc5ef015e01042 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement support for WeakMapLars Knoll2018-08-281-90/+0
| | | | | 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>
* 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-261-61/+0
| | | | | | | | | | 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-251-52/+0
| | | | | | | | 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>