aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsprimitivevalue.h
Commit message (Collapse)AuthorAgeFilesLines
* Replace std::variant with tagged union in QJSPrimitiveValueUlf Hermann2021-03-121-34/+175
| | | | | | | | | Fixes: QTBUG-91717 Change-Id: Id19e08589206253b96c76bc40a799ccd95b0e0bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 9970ebb277db5f11c8a7e72099fdd056a6d8310c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QJSPrimitiveValue: Implement modulo operatorUlf Hermann2021-02-191-0/+28
| | | | | | | | | | | The modulo operator has special semantics in JavaScript. We need to mirror those. Task-number: QTBUG-84369 Change-Id: I5a4d63a01e232686832c83f2def0faf57e7359c2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 84cf29933cee44e09590fc89ae800dd453f664ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QJSPrimitiveValue: Add a toVariant() method and ctor from QVariantUlf Hermann2020-12-181-0/+42
| | | | | | | | This is rather handy. Without it, we have to go through either QJSValue or QJSManagedValue, which causes much greater overhead. Change-Id: I40e2ecb6e2005f80c8f52b5e9a59028b3984eea4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add a QJSManagedValueUlf Hermann2020-12-181-0/+1
| | | | | | | | | | | | | A QJSManagedValue is a view on a QJSValue which always knows the engine the value belongs to. This allows us to implement the JavaScript semantics of the various QJSValue methods in a much more rigorous way. [ChangeLog][QtQml] The new QJSManagedValue should be used instead of QJSValue for manipulating properties and prototypes of JavaScript values, as well as for calling JavaScript functions. Change-Id: I9d445ffcf68dfa72dba9bae0818e83c80665ad66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow JavaScript primitive type transformations inline in C++Ulf Hermann2020-12-181-0/+569
We don't want to call into the engine just for adding two numbers. This implements the most common operators on primitive JavaScript values. More are to follow in the future. Change-Id: Id51a5af59a3af9fec78a2d8f293e59e6567e9204 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>