aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4reflect.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Cleanups in Value/PrimitiveLars Knoll2018-09-171-6/+6
| | | | | | | | | | | | Get rid of Primitive and move the corresponding methods directly into Value. Mark many methods in Value as constexpr and turn Value into a POD type again. Keep Primitive as a pure alias to Value for source compatibility of other modules that might be using it. Change-Id: Icb47458947dd3482c8852e95782123ea4346f5ec Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Small correctness fix in Reflect.ownKeys()Lars Knoll2018-09-091-10/+13
| | | | | Change-Id: If4af20d25781c663f55cf9d6107a660f6540869d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix dead temporal zone checking in module namespacesSimon Hausmann2018-08-291-3/+1
| | | | | | | | | | | | | | | 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>
* Implement support for call/callAsConstructor in Proxy objectsLars Knoll2018-08-231-2/+6
| | | | | | | | | | | 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>
* Fix Reflect.ownKeysSimon Hausmann2018-08-151-2/+22
| | | | | | | This function should not only return the names but also keys (symbols). Change-Id: I431e4aa8fa31ac6c16a415f00fb9f98405632562 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up the property key API in StringOrSymbolLars Knoll2018-07-021-7/+2
| | | | | | | | | | | | | | Get rid of makeIdentifier(), as toPropertyKey() will take care of it. Rename identifier() to propertyKey() and check that the key is valid. Remove String/StringOrSymbol::asArrayIndex(), we don't need it anymore. Change-Id: I3c490fabc1475c9ea288b49b1638b6fa1bc237b7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace Identifier by PropertyKeyLars Knoll2018-07-021-4/+4
| | | | | | | | Change all uses of Identifier to use the new PropertyKey class and get rid of Identifier. Change-Id: Ib7e83b06a3c923235e145b6e083fe980dc240452 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Introduce a PropertyKey class that inherits from ValueLars Knoll2018-07-021-8/+9
| | | | | | | | | | | This will replace Identifier over the next few commits. The advantage of PropertyKey is that it can be stored on the JS stack, so that a GC run won't accidentally clean up the string/symbol referenced by the key. Change-Id: Ib4daa4616bcfa537e6d371ef7c7740bc7727a50d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Unify the get and getIndexed vtable functions of QV4::ObjectLars Knoll2018-07-021-12/+7
| | | | | | | | This finalizes the refactoring of Object's vtable API. Also added the receiver argument to the method as required by the ES7 spec. Change-Id: I36f9989211c47458788fe9f7e929862bcfe7b845 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Unify put and putIndexedLars Knoll2018-07-021-8/+3
| | | | | | | | | | Pass an Identifier through those virtual methods to unify the string and integer based versions. Also add the receiver that's required in ES7 Change-Id: I4e7f01b4c97cc80bcb3c485f6343f28213dc9e6b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Cleanup defineOwnPropertyLars Knoll2018-06-261-1/+1
| | | | | | | | | | | | | | | | Make it a vtable method as required by the ES7 spec. Change all calls sites to call through the virtual function. Adjust ArgumentsObject and give it it's own defineOwnProperty implementation instead of hacking it into the base implementation. Move the array object specific handling into a reimplementation. Change-Id: I48c960c4c69f99b178628c94b4808be2bab0dccc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add Proxy support for prototype handlingLars Knoll2018-06-251-5/+10
| | | | | | | | | | | | | | Cleanup get/setPrototypeOf and fix some smaller incompatibilities in the default implementation for Object. Add the methods to the vtable and reimplement them according to spec for ProxyObjects. Clean up the Object.prototype.get/setPrototypeOf/__proto__ methods and fix a smaller bug in the Reflect API for those methods. Change-Id: I6e438753332ec4db963d6cdcf86f340ff212777a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Support preventExtensions in Proxy handlersLars Knoll2018-06-251-2/+1
| | | | | Change-Id: I03aaacc260bdb46eb09c597598a45fbb25d6d7b6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for ReflectLars Knoll2018-06-211-0/+270
Implemented all methods in Reflect, only some smaller bugs left in there. Change-Id: I53d2304d0e59566aec64e200cd995e02afcfc33e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>