Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmljsfunctioninitializer_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3// Qt-Security score:significant
4
5#ifndef QQMLJSFUNCTIONINITIALIAZER_P_H
6#define QQMLJSFUNCTIONINITIALIAZER_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17
18#include <private/qqmljscompilepass_p.h>
19
21
23{
24 Q_DISABLE_COPY_MOVE(QQmlJSFunctionInitializer)
25public:
26 QQmlJSFunctionInitializer(
27 const QQmlJSTypeResolver *typeResolver,
28 const QV4::CompiledData::Location &objectLocation,
29 const QV4::CompiledData::Location &scopeLocation,
30 QQmlJSLogger *logger)
31 : m_typeResolver(typeResolver)
32 , m_logger(logger)
33 , m_scopeType(typeResolver->scopeForLocation(scopeLocation))
34 , m_objectType(typeResolver->scopeForLocation(objectLocation))
35 {}
36
37 QQmlJSCompilePass::Function run(
38 const QV4::Compiler::Context *context, const QString &propertyName,
39 QQmlJS::AST::Node *astNode, const QmlIR::Binding &irBinding);
41 const QV4::Compiler::Context *context, const QString &functionName,
42 QQmlJS::AST::Node *astNode);
43
44private:
45 void populateSignature(
46 const QV4::Compiler::Context *context, QQmlJS::AST::FunctionExpression *ast,
47 QQmlJSCompilePass::Function *function);
48
49 const QQmlJSTypeResolver *m_typeResolver = nullptr;
50 QQmlJSLogger *m_logger = nullptr;
51 const QQmlJSScope::ConstPtr m_scopeType;
52 const QQmlJSScope::ConstPtr m_objectType;
53};
54
55QT_END_NAMESPACE
56
57#endif // QQMLJSFUNCTIONINITIALIZER_P_H
QQmlJSCompilePass::Function run(const QV4::Compiler::Context *context, const QString &functionName, QQmlJS::AST::Node *astNode)
static QString bindingTypeDescription(QmlIR::Binding::Type type)
static void diagnose(const QString &message, const QQmlJS::SourceLocation &location, QQmlJSLogger *logger)