Commit Graph

106 Commits

Author SHA1 Message Date
Maximilian Goldstein 0790bc85a1 qmlcompiler: Add proper null type
Previously we treated null as a generic primitive value (in functions)
or as a var type (in literal bindings), this change ends this practice
by introducing an uniform null type used everywhere and defined in
builtins.

Now we can also properly warn about setting properties to null if they
aren't variants.

Fixes: QTBUG-98409
Change-Id: If32420a59948696491f24521bbc0f251095a9699
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-01-17 19:53:06 +01:00
Ulf Hermann bd0f4459ce Re-allow retrieval of list properties in QQmlJSCodeGenerator
It's not particularly slow. It probably was when we were using
QQmlListReference or JavaScript arrays.

Pick-to: 6.3
Change-Id: I1a4575a5b84cdfb732a6c3615d00bbe2abaffc94
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2022-01-15 14:22:42 +01:00
Andrei Golubev 1d1ad6cbc7 Unify common logic around QQmlJSScope and friends
We have many things duplicated all over the place

Pick-to: 6.3
Change-Id: If929a5d683153781f6db630312240bf9c24ec777
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2021-12-22 15:43:27 +01:00
Ulf Hermann 0ea14fa126 QmlCompiler: Don't try to get attached objects for non-QObject*
We might end up in this situation if we don't know enough about the
base of the attached lookup. This would generate invalid C++ code.

Pick-to: 6.2 6.3
Change-Id: I210077388d0d1d0d4e9454bd3ba3792af9b42049
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-17 12:43:14 +01:00
Ulf Hermann 7d911956b9 QmlCompiler: Disallow access to IDs in other components
There is no guarantee that this works.

Fixes: QTBUG-98830
Pick-to: 6.2
Change-Id: Id205170a41caa4bed264864a1ff35a57303641e9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-03 08:20:52 +01:00
Ulf Hermann 6d5c2cecdd QmlCompiler: Add a code generator
We're going to use this in qmlcachegen.

Task-number: QTBUG-98305
Change-Id: Ie2c945751041bf99af9fbc22dfa5665cd0201446
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-11-26 11:58:07 +01:00