From 7957752447fbd2581521b13156ef29ffc80ad7bf Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 30 Sep 2020 14:44:24 +0200 Subject: qmllint: Unify injected and "normal" JavaScript identifiers The specifics of how to warn about the injected identifiers are moved out of ScopeTree as that is not related to the structure of the scopes. Change-Id: I26418c3fa492da8339abf045a4034a8464b7bbb8 Reviewed-by: Fabian Kosmale --- src/qml/common/qqmljssourcelocation_p.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/qml/common/qqmljssourcelocation_p.h b/src/qml/common/qqmljssourcelocation_p.h index 7c75541eb1..ba183f394e 100644 --- a/src/qml/common/qqmljssourcelocation_p.h +++ b/src/qml/common/qqmljssourcelocation_p.h @@ -41,6 +41,7 @@ #define QQMLJSSOURCELOCATION_P_H #include +#include // // W A R N I N G @@ -76,6 +77,18 @@ public: quint32 length; quint32 startLine; quint32 startColumn; + + friend size_t qHash(const SourceLocation &location, size_t seed = 0) + { + return qHashMulti(seed, location.offset, location.length, + location.startLine, location.startColumn); + } + + friend bool operator==(const SourceLocation &a, const SourceLocation &b) + { + return a.offset == b.offset && a.length == b.length + && a.startLine == b.startLine && a.startColumn == b.startColumn; + } }; } // namespace QQmlJS -- cgit v1.2.3