aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v6.2.11-lts' into tqtc/lts-6.2-opensourceTarja Sundqvist2024-11-221-3/+5
|\ | | | | | | | | | | | | | | | | Qt 6.2.11-lts release Conflicts solved: dependencies.yaml Change-Id: I088fe99748b323fbdf49c3766c262eb2a05131d9
| * QtQml: Register function type annotations as mandatory type referencesUlf Hermann2023-11-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | If they can't be resolved, we cannot continue. Fixes: QTBUG-117788 Change-Id: Id3e81853f802419f1121ef5e856c3272a3c977a1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit bf2258e6f44f1279eee5e9c2dd595c5dd2020784) (cherry picked from commit ae9f6b1743ab94a7509b3a77f60e110cde2016a1) Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 1b0d82b80c43a13db694eb477d6b80d7ceca4314)
| * Remove unused enumTableSize variableShawn Rutledge2023-09-271-2/+0
| | | | | | | | | | | | | | | | | | | | Clang complains. variable 'enumTableSize' set but not used [-Werror,-Wunused-but-set-variable] Change-Id: Ifb26309a4928e8d5cac123df843f9308d1c590cb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit fa4fe8f2c08d8c3c717d73f1b7a2366d18407868) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/tqtc/lts-6.2.7' into ↵Tarja Sundqvist2023-10-032-53/+13
|\| | | | | | | | | | | tqtc/lts-6.2-opensource Change-Id: Ib72ded968b7ac6b75b499392162e3cf3b761ec48
| * qqmltypecompiler: align runtime function table order to qmlcachegenAndrei Golubev2022-10-122-53/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we write runtime functions to compilation unit at run time, the order of the functions in the unit (often) differs from the order of functions in the unit produced ahead of time by qmlcachegen and friends. Additionally, the order also differs from what qmltc expects (and qmlcompiler library in general) Fix the order by simplifying the procedure of JS code generation when we create the compilation unit at run time: new logic just goes over the objects in the document linearly, instead of relying on bindings (which are known to be out of order w.r.t. AST) Fixes: QTBUG-106800 Change-Id: I4070b9d061f03c4c76d03120654ad3f30725493a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 8d0adee3b3317f1fab03742bdf0f7cdbe57df914) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Revert "Update commercial license headers"Tarja Sundqvist2022-11-2419-406/+406
|/ | | | | | | | | | | This reverts commit 74089697cf2a4961fb697100555b17ae2342d734. Revert of commercial license headers is required for the Qt 6.2.x opensource releases, Qt 6.2.5 onwards. Task-number: QTBUG-107760 Change-Id: Id49069cb5e5f261da185fd082dfb71deb259d387 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML: Port QV4::CompiledData::Binding to new special integer bitfieldUlf Hermann2022-06-131-36/+41
| | | | | | | Task-number: QTBUG-99545 Change-Id: I9f8bc5fa45c61f77ee95b055a3d8de001da8f8c5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 36ebee4e69182f0e44d87691d4740b271e1dcf38)
* QML: Port QV4::CompiledData::Object to new special integer bitfieldUlf Hermann2022-06-132-3/+7
| | | | | | | | Task-number: QTBUG-99545 Change-Id: Ia57a16313e883a8d4dab15c971181440ed1d2214 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 745cce4391a8b6255605cb304d8bc14b11168423)
* QML: Port QV4::CompiledData::Property to new special integer bitfieldUlf Hermann2022-06-131-7/+7
| | | | | | | | Task-number: QTBUG-99545 Change-Id: I46f9151536ba09417d117d690d7347bd91c13e75 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 6be0db416b867d432a826556dfc00929ecd77aba)
* QML: Port QV4::CompiledData::ParameterType to new special integer bitfieldUlf Hermann2022-06-131-7/+5
| | | | | | | | Task-number: QTBUG-99545 Change-Id: I515aa7a605accc4b45f9dd4918dd6bfb6e116379 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 2642058df8429cd593d0c7adf45a818a42fc0d88)
* QML: Port QV4::CompiledData::Alias to new special integer bitfieldUlf Hermann2022-06-131-6/+6
| | | | | | | | Task-number: QTBUG-99545 Change-Id: I554f9f903a39a83eaf601fd4fd932f685bf343d0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 8d03b13a59a5e3866c982eb14ca2dc57b687d218)
* QML: Port QV4::CompiledData::Location to new special integer bitfieldUlf Hermann2022-06-133-45/+25
| | | | | | | | Task-number: QTBUG-99545 Change-Id: If0d6f893f2351a4146ddf125be4079b5e312f308 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 893b6ae6e890a2b8fc842d9c9cc64b9b8f34e22f)
* QML: Port QV4::CompiledData::RegExp to new special integer bitfieldUlf Hermann2022-06-041-10/+7
| | | | | | | | | Task-number: QTBUG-99545 Change-Id: I37be080387bf086d84761b056140cc5a99d161ed Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit da09f7c3d8962b4521189c96adf1ed0e1da3e8dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Port QV4::CompiledData::Lookup to new special integer bitfieldUlf Hermann2022-06-042-17/+5
| | | | | | | | | Task-number: QTBUG-99545 Change-Id: I8cc6db56642f1cd2d16e80ba5c49ffd7c6fdcd8c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 6d92633f32ff2089b8f0a39e07f0d40bf57d8011) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Port QV4::CompiledData::JSClassMember to new special integer bitfieldUlf Hermann2022-06-041-2/+1
| | | | | | | | | Task-number: QTBUG-99545 Change-Id: I0a7d86450011f1664d61db4d78317dafbcfbb8cf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit b5a8a6943ab979e23db284780df9209af5ae03a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update commercial license headersTarja Sundqvist2022-06-0419-406/+406
| | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qtdeclarative. Examples, tests, or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4941 Change-Id: I32f554b0a8cb527f74d46f3c02b0e745d9fc5ddf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* JavaScript: Make "this" available in blocks inside arrow functionsUlf Hermann2022-02-021-5/+10
| | | | | | | | Fixes: QTBUG-98039 Change-Id: I51ff36994fa0f3f3568c8114cb6841f677f64bc4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit eeec9f03e9cf57e8cde311897f7e3e62a217da15) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML/JS: Reject yield expression not directly in generator functionsFabian Kosmale2021-12-091-0/+11
| | | | | | | | | | | | If an inner function contains a yield expression, we need to reject the program even if that function is inside of a generator function. Fixes: QTBUG-98356 Change-Id: I2e820a1ca5f0da4080e313fd9809aa8bfdc1b681 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit dde1d86baabac1eddd84a11b7d2ed49e26c511bd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle function as default arguments in toplevel functionsFabian Kosmale2021-11-112-0/+13
| | | | | | | | | | | | | | | | | | | | | | Top level functions, that is, those directly defined in a QML component as opposed to those defined inside another function or class, are not visited directly by the ScanFunction visitor. Instead, they are manually considered in generateJSCodeForFunctionsAndBindings, and the visitor is then run on their body. This worked mostly fine, with one notable exception: In case there is a function expression used as the default value of a function parameter, that function would have never been visited. This would lead to subsequent asserts/crashes in the codegen, as the function was not properly set up. We fix this by manually visiting the function's formals in addition to the body. Fixes: QTBUG-98032 Change-Id: I5cb4caae39ab45f01a0dfa1555099d7d4b796a19 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit be194d965d530e57ed5851781c6805e691c6ae98) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix scoping of JavaScript function namesUlf Hermann2021-09-292-11/+31
| | | | | | | | | | | | | | | | | | | | Function declarations add their name to the outer scope, but not the inner scope. Function expressions add their name to the inner scope, unless the name is actually picked from the outer scope rather than given after the function token. We don't add the name to any scope in the case of functions declared in QML elements because the QML element will receive the function as appropriately named, and typed, property. It is always better to use that one than to use a JavaScript local. This causes some additional ecmascript tests to pass. Fixes: QTBUG-96625 Change-Id: I0b8ee98917d102a99fb6b9bd918037c71867a4a5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b3fe31a0ff129bb87f81901f2f50c0041b8f4a80) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disallow alias property and normal property having the same nameFabian Kosmale2021-08-241-1/+12
| | | | | | | | | | | | | | This was an oversight: We only checked that normal properties have unique names, and that alias properties have unique names, but we neglected to check that alias properties and properties do not have name collisions either. Fixes: QTBUG-94456 Change-Id: I0fa7666b143bc84f4dc5b2ad6e62427adff60cd7 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 28d133a8a779f9bf1432a6003456b62f74b3c492) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* When binding signals, run the outer function to get the nested oneUlf Hermann2021-08-171-3/+15
| | | | | | | | | | | | | | | | The outer function may perform important tasks like setting up a call context with a "this" member for the nested function. In particular, arrow functions retain their original "this" member, no matter where they are executed later. We can detect this condition while generating the compilation unit. If the outer function is not a simple wrapper that only returns the inner function, execute it when binding a signal. Fixes: QTBUG-95659 Change-Id: I7dfef2c78378588e6bfc4bedde7889c7f2ce03ef Reviewed-by: Yuya Nishihara <yuya.nishihara@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 8cd7aabfb24b391143b3c358f49fb6a28765d5f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlIRBuilder: Always preserve "undefined" stringFabian Kosmale2021-08-091-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | QQmlIRBuilder skips storing binding scripts as a string to save memory. However, for QQmlScriptString, we need the string to be available. This is solved by running QQmlScriptStringScanner in the type compiler at runtime, which sets the correct stringIndex for script string bindings. However, that one does not run when we already have a compilation unit from cachegen (and if we would run it unconditionally, we still would miss the source code to recover the string). We work around this issue by noting that QQmlScriptString only cares about a very limited set of strings: Namely the various literals and undefined. The literals are already correctly handled, as IRBuilder has specific optimizations for them anyway. We now check in the generic case whether the bindings string equals "undefined", and if so, ensure that the string is registered. Fixes: QTBUG-91165 Change-Id: I4c4696952a082d1e69e0c9e5a0b9bf2470d59187 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit dd86881520dde6c1487e5397f10b82584e6b9eaa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Treat substitution free template string literals as string bindingsFabian Kosmale2021-07-231-0/+6
| | | | | | | | | | | | | Before this change, they were treated as script bindings, which are less efficient, and could not be used in ListElement. Fixes: QTBUG-95139 Change-Id: Ic66052c7f58b3ffdf1b7c0c169f42b4f99df62a1 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e8121d93003f621a6d91e32c1539945a0779745a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Evaluate type assertions in QMLUlf Hermann2021-05-263-3/+15
| | | | | | | | | | | | | | | | | | Type assertions actually check whether the expression matches the type, and return null if it doesn't. [ChangeLog][QtQml] You can use TypeScript-like type assertions using "as" now. In contrast to TypeScript, QML's type assertions are enforced at runtime. If the type doesn't match, null is returned for object types. Also, type assertions can only cast to object types. There is no way to create a value type or primitive type reference. As value types and primitives cannot be polymorphic, this doesn't matter, though. There are other ways of converting those. Task-number: QTBUG-93662 Change-Id: I00fce3d4ea7a8c6b4631c580eaf6c113ac485813 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add Q_ASSERT for _context pointer to pacify code checkerVolker Hilsheimer2021-05-201-2/+21
| | | | | | | | | | | | The pointer is initialized to nullptr, set in enterEnvironment, and possibly reset in leaveEnvironment. The static analyzer can't know that it is always set before any of other functions is called, so assert that pre- condition via Q_ASSERT. Pick-to: 6.1 Change-Id: I0198505db40a93227ba52a08c29a351e85b74cc0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* qqmlirbuilder: Fix deep inline component script bindingsMaximilian Goldstein2021-05-121-2/+3
| | | | | | | | | Previously when having an inline component inside any component that was not the root component, we hit an assert when using a script bindings. This was due to us not generating script bindings for any more deeply nested components. Now they work regardless of component depth. Change-Id: I700cf918f955aa99076006d53fb20358ff06e75f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix C4267 warning in qqmlirbuilder.cppKai Köhne2021-04-201-2/+2
| | | | | | | Fixes: QTBUG-92966 Pick-to: 6.1 Change-Id: I9acdb0d624a0950f9e28c6463530b27d282123e2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qqmlirbuilder: Fix treating parser warnings as errrosMaximilian Goldstein2021-04-191-1/+3
| | | | | | | | | | Previously parser warnings (i.e. inline components having lowercase names) were treated as errors. Because these were not handled properly this also resulted in the QQmlComponent with the warning never becoming ready. This resulted applications hanging instead of terminating. Pick-to: 5.15 6.0 6.1 Change-Id: Ia5ad3b54edc1b94dd94d0bf771c3494691abec71 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qv4codegen: Fix codecheker warning about invalid base referencesMaximilian Goldstein2021-04-141-0/+1
| | | | | Change-Id: Ie5a229d7e62d8df356359094e7e6d38530672a43 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Implement optional chainingMaximilian Goldstein2021-04-135-16/+275
| | | | | | | | | | | | | | | | | This change implements optional chaining (https://github.com/tc39/proposal-optional-chaining) by adding a new type of optional lookup with an offset to the end of a chain. If `undefined` or `null` is encountered during an access marked as optional, we jump to that end offset. Features: - Full support for all kinds of optional chain - With some codegen overhead but zero overhead during normal non-optional FieldMemberExpression resolution - Properly retains this contexts and does not need to resolve anything twice (this has been an issue previously) - No extra AST structures, just flags for existing ones [ChangeLog][QtQml] Added support for optional chaining (https://github.com/tc39/proposal-optional-chaining) Fixes: QTBUG-77926 Change-Id: I9a41cdc4ca272066c79c72b9b22206498a546843 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QV4CompilerScanFunctions: Silence code checker warningFabian Kosmale2021-03-301-1/+3
| | | | | | | | | | | | The AST is constructed in such a way that having exportAll set always implies that a fromClause exists. Also, clean up exportAll: We do not need a separate member to track it. Its value is fully determined by the presence of fromClause and exportsClause. Thus, replace it with a function. Change-Id: Ib7db2bbaf326ecc36a7f4a2986a7c1fb54db6cd5 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Expose lookups to AOT compiled functionsUlf Hermann2021-03-231-0/+2
| | | | | | | | This is based on QJSValue for now, but can be extended to operate on QMetaType/void* later. Change-Id: Ic63d4c9081090998afcca63ff3253963ff5096a2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Make retrieval of a signal name from a handler accessibleUlf Hermann2021-02-192-0/+20
| | | | | | | | We want to do that in other places, too. Pick-to: 6.1 Change-Id: Id42495d239c2dccffa390478c8b57ec1acab7408 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Warn about usage of injected signal parametersUlf Hermann2021-02-124-15/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | You should declare functions with formal parameters if you want to use parameters passed by the signal. We need to generate two different warnings because there are two code paths by which such parameters are injected. If we compile with qmlcachegen, it simply inserts a lookup instruction in to the byte code. This lookup then triggers our special hack expressly made for signal parameters. If we don't compile using qmlcachegen, a function declaration with formal parameters is synthesized. We mark those formal parameters as injected and warn if we see one of them used. [ChangeLog][QML][Important Behavior Changes] The automatic injection of signal parameters into signal handlers is deprecated. This is because we cannot determine the names of the signal parameters at compile time. Furthermore, also for human readers it is difficult to discern between arguments, context properties, properties of the current object, and properties of the root object of the component. Requiring the signal parameters to be explicitly named resolves some of this confusion. You can turn the deprecation warning off using the "qt.qml.compiler" and "qt.qml.context" logging categories. Task-number: QTBUG-89943 Pick-to: 6.1 Change-Id: If0a5082adb735a73efd793868b3a55bc7d694cbe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QML: Warn about variables being used before their declarationUlf Hermann2021-02-114-13/+35
| | | | | | | | | | | | | | | | | | This collides with injected signal parameters. qmlcachegen cannot tell those cases apart. [ChangeLog][QML][Important Behavior Changes] QML warns about JavaScript variables being used before their declaration now. This is almost always a mistake. It is particularly dangerous in the presence of injected signal parameters because qmlcachegen cannot identify a name collision between an injected signal parameter and a variable being used before its declaration. It therefore miscompiles such code. You can turn off the deprecation warning using the "qt.qml.compiler" logging category. Pick-to: 6.1 Task-number: QTBUG-89943 Change-Id: I8a9424ca8c6edd562402fe5c560ba7e8344b5585 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Build fixes for GCC 11Ville Voutilainen2021-01-181-2/+2
| | | | | | Task-number: QTBUG-89977 Change-Id: I975a859d5252e2721475f86ced6c8dab06ae8c9c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-29/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* V4: Add reset() method to the byte code handlerUlf Hermann2020-12-041-0/+1
| | | | | | | | This is necessary if you want to parse the same byte code in multiple passes. Change-Id: I8d3e9739b7cb3682d0f1d26e675ead8b7ce66a93 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Introduce "pragma Strict"Ulf Hermann2020-11-262-4/+10
| | | | | | | | | | This doesn't carry any meaning, yet, but it can be used by any tools to apply stricter rules to a particular piece of QML. Change-Id: I0bf8f22001c19c7cc2989abedc747d3d5b1bdee1 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlIR: Make sure that all objects receive a locationUlf Hermann2020-10-222-13/+35
| | | | | | | For grouped properties, this is the location of binding now. Change-Id: I7148ba92150e3569d47c382ef78794bfa3b75fce Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix ubsan errorAllan Sandfeld Jensen2020-09-231-5/+9
| | | | | | | | memcpy can't officially copy from nullptr, not even 0 bytes. Pick-to: 5.15 Change-Id: Ie6ede9a861cb2ae7ab35a50db5aa6c82cea6ad76 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Unify "variant" and "var" properties in QMLFabian Kosmale2020-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | variant and var properties differ in two important ways: - variant properties trigger "magic" string conversions: variant v1: "red" // contains a QColor var v2: "red" // contains a string - variant properties behave differently for value types: they create copies, instead of references. However, as variant properties were marked as obsolete and this behavior was effetively undocumented, it should be safe to give "variant" "var semantics". With this change, we can also avoid doing magic conversions when storing data in QVariant properties of QObjects/QGadgets Change-Id: I549b1beb98e6af9639c1ee81f316bda513d5ff65 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Port QtDeclarative from QStringRef to QStringViewKarsten Heimrich2020-06-166-35/+35
| | | | | | | | Task-number: QTBUG-84319 Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Prettify QV4_SHOW_BYTECODE output for JS classesUlf Hermann2020-05-261-11/+12
| | | | | | | | | | | Drop all the double spaces, force a line break after each class, and avoid converting empty strings to utf8. Coverity-Id: 190711 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I789291e257aeac97c2a931bfc604f453c39906eb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qv4compilercontext: avoid potential null deferenceFabian Kosmale2020-05-191-1/+4
| | | | | | | Coverity-Id: 274162 Pick-to: 5.15 Change-Id: I58e23d600e9778f5149258fac58657c1a165e0c0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-03-182-0/+7
|\
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-182-0/+7
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tools/qmllint/findunqualified.cpp Change-Id: I2593b5cc0db1d14e0c944aec4b88a80f46f5b0c1
| | * Inline components: Abort if two IC's with same name existFabian Kosmale2020-03-162-0/+7
| | | | | | | | | | | | | | | Change-Id: Ic52fa388711a76d729ae28678932f4a150da9583 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Also support partly specified versions in JS .importsUlf Hermann2020-03-181-1/+1
|/ / | | | | | | | | | | Task-number: QTBUG-71278 Change-Id: Ie3167d44780a192b5010052eea5192eee8c21c32 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>