aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsprimitivevalue.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Fix \fn template arguments for Qt QmlLuca Di Sera2023-11-301-1/+1
| | | | | | | | | Upcoming changes to QDoc require accurate definition for template arguments in \fn commands. Task-number: QTBUG-118080 Change-Id: Ic61ecace84913f5059fbec21371455741b1bfafe Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QmlCompiler: Improve argument construction in generated codeUlf Hermann2023-05-111-0/+11
| | | | | | | | | | | | | We don't have to pass types that don't fit if we actually have the correct types in suitable wrappers. This still invokes the internal conversions of the call frame setup if we call with really generic types, for example if the same value is read multiple times with different target types. However, that is acceptable. Fixes: QTBUG-113465 Change-Id: I8ec4afeb39bbe6585e5268c0e9b0cfd2788d761a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix QJSPrimitiveValue::to() \fn signatureTopi Reinio2023-03-201-2/+3
| | | | | | | | And add \since information. Change-Id: I3634a3b2dbc48e63fac4810cfc0c1a5137e925db Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QJSPrimitiveValue: Add data(), metaType() and a generic coercion methodUlf Hermann2023-03-171-0/+33
| | | | | | | This allows us to do some more specialized lookups in QmlCompiler. Change-Id: I7947c8e7bccfa57aee949b080a531a88fd47c8af Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Implement Math.pow()Ulf Hermann2022-07-211-0/+11
| | | | | | | | | Also, add missing positive infinity to test data. Pick-to: 6.4 Fixes: QTBUG-104745 Change-Id: I958aca672cca8cc83c540ed3ea75b08e70eb90fd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Really fix writing into argument valuesUlf Hermann2022-07-051-0/+23
| | | | | | | | | | | | | | | | | | | | | | Arguments are now treated as registers "written" at the beginning of the first basic block. By modeling them this way, we can avoid all the complicated logic on whether to use a local or the arguments array when accessing any particular one of them. Furthermore, we can detect whether they are overwritten or not. If they are not overwritten, we can initialize them as a const reference into the arguments array. This way we save a copy. Treating the arguments as generic registers causes the basic blocks pass to aggressively adjust their types, pushing some conversions back into the QML engine. This is good. Unused arguments become void, for example, and don't have to be passed at all. However, we also need a special case for QJSPrimitiveValue arguments now. Pick-to: 6.4 Fixes: QTBUG-104462 Change-Id: I994bea0929bd508aa41db58dee4a7f12cd20f053 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Fix QDoc warnings qtdeclarativeNico Vertriest2021-06-171-0/+7
| | | | | | Pick-to: 6.2 6.1 Change-Id: Ib53e0bc6e30440a5e2c84a0f37bc6cb0e424b821 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add missing \inmodule commandNico Vertriest2021-02-121-0/+2
| | | | | | Task-number: QTBUG-90439 Change-Id: I0e29e2ee090d5aa4ae40bcca4bd5fa14f87d9c0c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix CI warnings qtdeclarativeNico Vertriest2021-02-121-10/+10
| | | | | | | | Fix errors with \fn and hidden friend functions Task-number: QTBUG-90439 Change-Id: I1de021c953efdd397de4bb25cbe3180175265174 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Allow JavaScript primitive type transformations inline in C++Ulf Hermann2020-12-181-0/+288
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>