| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This symbolizes the last piece of QmlIR dependency that qmltc has.
We do still have some implicit dependencies on QmlIR, though, but
that should go way once the remaining prototype code's logic is
migrated to QmltcVisitor, QQmlJSScope and friends. This, however,
is not attempted here as the patch itself is rather large
In the process of switching to QQmlJSMetaPropertyBinding, observe
and fix issues in QmltcVisitor and surroundings
Pick-to: 6.4
Change-Id: I752b68a7f57baf354de16dc0bb466a3f693a4e49
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
| |
Looking at this class without IDEs is slowly becoming a pure pain. Make
it a little better by grouping "main" members together and moving them
Pick-to: 6.4
Change-Id: I3a4451a89d66ac0dbd3572dbae1cba9a628dbf60
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
| |
It also handles translations for a while now, a generic name is better
Pick-to: 6.4
Change-Id: I469eb141d877e822a17a4c4e66a00039b4558442
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The logic is misbehaving on multiple occasions. For instance,
same-named signal handlers in different scopes and script bindings
inside array scopes were wrongly handled. Fix that by revising
the mechanism of inner function computation
As a drive by, fix parseLiteralOrScriptBinding() to distinguish
translation bindings from script bindings (they are vitally
different now)
Extend the script calculation test in tst_qqmljsscope to cover
the findings
Pick-to: 6.4
Change-Id: Ic4cf0a4539f0d714a416b61f4635eb6494e89922
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Found by UBSAN:
qqmljsimporter_p.h:122:12: runtime error: load of value 4, which is not a valid value for type 'bool'
qqmljsimporter.cpp:412:20: runtime error: load of value 4, which is not a valid value for type 'bool'
Fix by explicitly initializing the bools in Import. This is what
adjacent classes do, and in line what the users apparently expect.
Amends 687609f2f3a98ade4b8e074615c3d1db1228fce0.
Change-Id: I143be1a8d239bbe8c6f00be554b5b678238de91f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
If the element type is unknown the list type is also unknown. This will
happen if we cannot resolve the type.
Fixes: QTBUG-103920
Change-Id: If1b05d99a1e64961981b5adb3974a51c11e776d2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
In many cases we need to also check base an extension types since
we don't always have direct inheritance
(i.e. very common with QtQuick.Controls)
Change-Id: I66307b7d0081d49611a9e61847e4363d5819bf82
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can get into situations when binding creation is problematic
due to the relevant scopes being yet unresolved. In particular,
this happens when processing attached/group properties script
bindings
Avoid having this situation by postponing the actual binding
setting until after the relavant scopes are resolved (mainly,
the binding owner). However, do relevant AST order dependent
operations beforehand to avoid accidental errors
This commit amends 25098b7a4fdb8920874a817956f659e6393548d2
Fixes: QTBUG-103897
Change-Id: I671955dbe321d03e5f1ab9891cc79dc0a936deda
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Group scopes may be value types so they require access semantics
different from a default value
Ordinary scopes and attached scopes seem unaffected, only groups
are thus covered with an extra logic
Change-Id: Ia9012548a602ca7ca07296491d27a295f4455f91
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
In JavaScript the [] operator on strings returns a string. QString's
operator[] returns a QChar, but we can easily create a string from that.
Fixes: QTBUG-103371
Change-Id: Id5c960f00ecc7a5dfe30ccbcaac3ffb2a30308b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of the storedType hack in the type resolver, properly declare
the type LoadElement can return: A merge of undefined and the actual
type. This way we can choose the best concrete type to use for this
independently (and optimize it later).
Task-number: QTBUG-103529
Change-Id: I17b1f835f6a893ec843a90491e92f72ecb2e87fe
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
If components are bound we can assume the IDs of outer components are
reachable.
Fixes: QTBUG-102806
Fixes: QTBUG-101012
Change-Id: Ia26d3963d6c2fb9698debb12f9c655c5522f81ea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Doubles can be stored directly. If we wrap them into QJSPrimitiveValue
we just induce unnecessary conversions.
Pick-to: 6.2 6.3
Task-number: QTBUG-103560
Change-Id: I34b4ac46afe72f1532362f0aaf156c4a30704f88
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This makes sure the different instances of the list types are
interconnected. Without this we don't recognize them as related and
create a lot of temporaries and conversions to handle them.
Change-Id: I3fc30cf87727644e5085ecaae9bf14a2470ca159
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Added moduleName and qualifiedName to QQmlJSScope. Those
properties are written in the scopes after they were
loaded by readQmlDir.
Fixes: QTBUG-103299
Change-Id: I3b2c68c43c3bf0ac6cf801b0e54cf4b412b4d4e5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implements a very limited function type we mainly use for linting
purposes right now. This allows us to know when some binding or function
returns another function.
Limitations:
- We do not distinguish between generators and regular functions
- We do not record any parameter information or types
- We do not record any return types
- There is no code generation for actually utilizing these closures
Change-Id: Ic43218d9a1a3a3966d5afbd42943192e5a61c864
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We need them to be like this in order for our comparisons with IR output
to work.
Change-Id: If49faf015efbf0da0faabe9e01a2942cedea5b48
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
We only need to use temporaries if we either have different stored types
or if the stored type is QVariant and we have different contained types.
Change-Id: Ic72cdcb0ea4e58a79294337c3d9aa54efb866cfe
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
We previously hit an assert / crashed if we saw an empty script binding.
Fixes: QTBUG-103707
Change-Id: I117d984a7d315ecf860d2ada5568637d154ae083
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
Pick-to: 6.2 6.3
Fixes: QTBUG-103560
Change-Id: Ifcc73baf7f79e30f6e83ff3e500dd39f95790bfe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
QQmlListProperty is only for object lists. Object lists are the only
thing we can use in LoadElement for now.
Fixes: QTBUG-103529
Change-Id: Ia120addcfc0afcbf1815d1bd9671f20df8334744
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we would often suggest to add an id to the view containing
the delegate so you could access the model that way which is very
misleading and might be especially bad as an automatic suggestion.
This change now recommends that the user adds a required property,
although we currently lack the logic to properly insert one for the user.
Fixes: QTBUG-103101
Change-Id: I4cd858ff6617d12b9abf070f524dc626d699e4f1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change reimplements the PropertyPass to be based on bindings
rather than on just iterating over elements. This is a lot less
cost intensive than iterating over all properties regardless of
whether they are actually used. You may still achieve the same
thing with the more flexible element pass, just with the benefit
that you can choose what properties you want to iterate over
instead of iterating over all of them.
To demonstrate the passes usefulness the existing attached property
warnings are ported to use the binding pass and can now also warn
when an attached property is read or written in a context where
it's not supposed to be used.
Fixes: QTBUG-102860
Fixes: QTBUG-102418
Task-number: QTBUG-102859
Change-Id: Iea87a1b05b954429b8bf00fd27b60487940af679
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
| |
Coverity-Id: 392715
Change-Id: I5b38f070511965b1fd10cf286b7727acdb892fcb
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
| |
Pick-to: 5.15 6.2 6.3
Task-number: QTBUG-99545
Change-Id: I9f8bc5fa45c61f77ee95b055a3d8de001da8f8c5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Pick-to: 5.15 6.2 6.3
Task-number: QTBUG-99545
Change-Id: If0d6f893f2351a4146ddf125be4079b5e312f308
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QML_{NAMESPACE_}EXTENDED and QML_EXTENDED_NAMESPACE are supposed to
behave differently when it comes to visibility of properties, methods,
etc. Thus, make it so by actually using different class infos and
updating QQmlJSScope. Use a HasExtensionNamespace flag to differentiate
between extension and extension namespace (whenever one of them is set)
Update the internal search routine that traverses the base types and
extensions of the given scope
Change-Id: Ifafbb22f831f5b128e431a3e65c514ffdf65eb73
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not go over extension's base types since this is not how the engine
logic work. Instead, only assess the direct extension type when
traversing the base type hierarchy. The special cases are value types
which still need base type extension traversal (e.g. due to Number
and NumberPrototype extensions on primitives) and QObject type itself
(we expect to see ObjectPrototype properties / methods of it)
Pick-to: 6.3 6.2
Change-Id: I92ba979202b33f16e1a7b948d4f1e79df37f2669
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use it in QQmlJS{TypeResolver, Scope} now and the logic is less and
less trivial over time. To avoid accidental inconsitencies, move the
function to a common location
On top of this, adjust the logic so that we could work with 1-or-2
argument callables (2 arguments are sometimes needed in the resolver)
Change-Id: I27531837ca99cf5d8bcae626d885978903db4b0a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Previously it was not possible to disable cloning of types but we need
to do this in order for linting to not be disturbed. This patch adds
a flag that can be toggled to disable it, although it is still enabled
by default.
Change-Id: I5b19a48395e27975343fb1999d8106e0bb07d53a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Grouped properties do not bind to a default property and they are not
object definition scopes. Fix the subtle issue where we'd do the
opposite for `group { ... }` syntax
Submit the tst_qqmljsscope changes that made the issue visible
Pick-to: 6.3
Change-Id: I314b19d5cad62f70146d228e5402c9fc73b309ad
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we only warned when a component we were linting contained all
of the anchor properties causing a conflict. Now we also warn if the
combination is created across multiple components or files.
Also makes QQmlJSMetaPropertyBinding record undefined literals as they are
needed to tell whether a property has been reset somewhere in a type.
Task-number: QTBUG-102859
Change-Id: I04012848d0526cce6aea34036c6b2e0daf79cf9d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce an alias resolution procedure to query the origin
property and its owner for a given alias
Add alias compilation to the "proper" qmltc code and remove
the equivalent one from the prototype
Change-Id: I55bc1e3e6206b4cfce259526d1bc2813e8ea7cfb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-101408
Change-Id: Ic925751b73f52d8fa5add5cacc52d6dd6ea2dc27
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Implements QQmlJSScope::prettyName() which will strip off any internal
prefixes (such as $internal$ and $anonymous$) and also return some more
user recognizable type names (i.e. null instead of std::nullptr_t).
Change-Id: I085b51ea9fe6b348fb24efa93726c47b79846a8b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can transition to absolute indices (within the compilation unit)
from the relative indices we already have in each method and script
binding. Together with absolute indices, we also need to acknowledge
nested closures that some AST elements might have and so also store
nested runtime function indices along with the absolute ones
Absolute runtime function indices (and the nested ones) map to the
indices we store and use within the compilation unit at run time,
which are used to dispatch to correct JavaScript call during e.g.
binding evaluation - see QQmlEnginePrivate::executeRuntimeFunction()
Change-Id: Ieec58fbc36563511bd9763e358cda46c67757fa9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The type resolver should not do any semantic analysis on its own. This
fixes a bug triggered by invoking the literal type analysis from
qmlcachegen (which is not interested in literal bindings at all).
While this doesn't fix the root cause, qmlcachegen will definitely not
crash in this place anymore. There will be a follow-up bug to figure out
what is actually happening.
Pick-to: 6.3
Fixes: QTBUG-102598
Change-Id: Ic5b1f1cdebc960e0ec56f54d8bdd11bac08f0521
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove dubious if-statement guarding the environment creation for
script bindings
Address that script bindings might also exist in the case of:
`property var p: ...` which is not a UiScriptBinding but rather a
UiPublicMember AST element, thus making `property var p: ...` and
`p: ...` equivalent script-binding-wise
Change-Id: Ie9dc40e9387a61b40445be5683049c2f3590a061
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Store relative (to scope) index for every Script binding and JavaScript
function into the corresponding data structure within QQmlJSScope. We
need this at a later phase in qmltc when code generating JavaScript
calls into the engine
For now, ignore the logic that converts the relative indices stored into
the indices pointing to the runtime function table
While testing the addition, observe missing cases where we do not record
bindings as such and fix that
Change-Id: I85030b7937c97f83183f88ae242af3a5f223443c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have to either sort the input candidate list or ensure that we
always get same-ordered candidates at the call sites. The latter seems
rather problematic since we usually use QHash::keys() as candidates so
blarantly sort the candidates instead
Complexity-wise, this adds an extra O(n * log(n)) procedure (where n is
the size of the candidates list) which might or might not be amortized
by the main logic (depends on average input/candidate string lengths)
Change-Id: Ib528d453e2f4b2d6646f1451f5aefa559a0bdc10
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
In case of incomplete type information, we can get QJSValue as output
type where we expect QObject*. We cannot generate any sensible code for
that.
Change-Id: If817de7dca3b5b0b58aff92dec2dd12a7c10d250
Pick-to: 6.2 6.3
Fixes: QTBUG-102554
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend group property binding creation with attached properties case
As a drive by, add extra attached property tests for QML and qmltc,
covering the case where an attaching type exists in both base and
derived types
Task-number: QTBUG-102082
Change-Id: I6c0d2b941da72d6dab7fc05a4f7b2a7875423ef0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cover the following case of binding on a group property:
Type {
group { foo: 42 }
}
Task-number: QTBUG-100168
Change-Id: I0147c74dffb649907457d5f17a2ab29473101a6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ia6c1dfccf959c06ddb4e8c5bd0685828f9298f6f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
| |
Change-Id: I402eeeab1cd6f5e02d5f49eedbd01010de39d05a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a method to the PassManager to check whether a QML document has
imported a particular QML module.
This is important as a lot of linting passes only need to run when a
certain module is present and can be skipped otherwise.
Checking for the module is accomplished by adding an invalid
$module$.<URI> scope to the imported types generated by QQmlJSImporter.
This means that not only direct imports but also indirect imports caused
by a qmldir import line will be properly detected.
Change-Id: I341f916a43c60d373d205b5571104d5c5a533d61
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Adds a command line option and settings entry in order to
disable individual plugins. Previously you could only
disable all of them.
Fixes: QTBUG-102420
Change-Id: I5a35093c32f5f86eef1e31dd42b77c95e38bb01f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
If two plugins have the same name, warn about it and don't load the
second one.
Fixes: QTBUG-102421
Change-Id: If386acf9fbbfc12cec8ce708516c11940ef2856e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test standalone build (against the current Qt, not against a released
package).
The test checks load edit write. Edits can leave ids and prototypes
out of sync, so ignore them in the comparisons.
Do the following changes to be able to compile it as "external"
library:
- refer to imports in the same module with "", to that they are used
not the (potentially old) version of Qt.
- use % for concatenation (+ does not have all overloads by default,
% uses QStringBuilder that covers all cases)
Change-Id: I0d52c939d5985654cf0949fc70e0fc8bc6a7f063
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Turns out just cloning the root scope is not enough to avoid the
duplicated scopes after all. We'll just have to have the plugins run
before the compiler logic for now.
Change-Id: I5f44c7d14b5c3ade8e7fff0fbc98d14e34b875ec
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|