From 8ab237edf170f5b0482dccf5169868e5c7c47771 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 27 Feb 2020 10:49:14 +0100 Subject: Restore offset/length in QQmlJS::DiagnosticMessage This is needed in a few places outside of declarative, so this change restores the loc member in DiagnosticMessage and moves QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory. QQmlError is unaffected and retains only line/column. Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2 Reviewed-by: Fabian Kosmale --- src/qml/compiler/qv4codegen_p.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/qml/compiler/qv4codegen_p.h') diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h index 82a4fc3289..255698d790 100644 --- a/src/qml/compiler/qv4codegen_p.h +++ b/src/qml/compiler/qv4codegen_p.h @@ -661,12 +661,12 @@ protected: bool visit(QQmlJS::AST::UiSourceElement *ast) override; bool throwSyntaxErrorOnEvalOrArgumentsInStrictMode(const Reference &r, - const QQmlJS::AST::SourceLocation &loc); - virtual void throwSyntaxError(const QQmlJS::AST::SourceLocation &loc, const QString &detail); - virtual void throwReferenceError(const QQmlJS::AST::SourceLocation &loc, const QString &detail); + const QQmlJS::SourceLocation &loc); + virtual void throwSyntaxError(const QQmlJS::SourceLocation &loc, const QString &detail); + virtual void throwReferenceError(const QQmlJS::SourceLocation &loc, const QString &detail); void throwRecursionDepthError() override { - throwSyntaxError(QQmlJS::AST::SourceLocation(), + throwSyntaxError(QQmlJS::SourceLocation(), QStringLiteral("Maximum statement or expression depth exceeded")); } @@ -700,7 +700,7 @@ public: Reference referenceForName( const QString &name, bool lhs, - const QQmlJS::AST::SourceLocation &accessLocation = QQmlJS::AST::SourceLocation()); + const QQmlJS::SourceLocation &accessLocation = QQmlJS::SourceLocation()); QV4::CompiledData::CompilationUnit generateCompilationUnit(bool generateUnitData = true); static QV4::CompiledData::CompilationUnit compileModule( @@ -810,7 +810,7 @@ protected: private: VolatileMemoryLocations scanVolatileMemoryLocations(QQmlJS::AST::Node *ast); void handleConstruct(const Reference &base, QQmlJS::AST::ArgumentList *args); - void throwError(ErrorType errorType, const QQmlJS::AST::SourceLocation &loc, + void throwError(ErrorType errorType, const QQmlJS::SourceLocation &loc, const QString &detail); }; -- cgit v1.2.3