diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-06-18 10:40:57 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-10-12 17:23:33 +0200 |
| commit | 9527ad1a53cd5b75cd81bb996d3e5a5daeb2d732 (patch) | |
| tree | e092284624e260572aa30ef0000cca02a4a214ce /src/qmlcompiler/qqmljsfunctioninitializer.cpp | |
| parent | 5fc2bfd3697d36423d27fa630cba48f25f719841 (diff) | |
QmlCompiler: Simplify content variants for QQmlJSRegisterContent
Instead of having a cross product of "scope" and "object" on the one
hand and "property", "method" and "enum" on the other hand, use the
scopeType to resolve what kind of element a property, method or enum
belongs to.
Task-number: QTBUG-124670
Change-Id: Ia9db05e13979e55e0ed7912afc2003dfd018987a
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsfunctioninitializer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljsfunctioninitializer.cpp b/src/qmlcompiler/qqmljsfunctioninitializer.cpp index c486ac273b..309bea8dff 100644 --- a/src/qmlcompiler/qqmljsfunctioninitializer.cpp +++ b/src/qmlcompiler/qqmljsfunctioninitializer.cpp @@ -162,7 +162,9 @@ QQmlJSCompilePass::Function QQmlJSFunctionInitializer::run( bindingLocation.startColumn = irBinding.location.column(); QQmlJSCompilePass::Function function; - function.qmlScope = m_typeResolver->globalType(m_scopeType); + function.qmlScope = QQmlJSRegisterContent::create( + m_scopeType, QQmlJSRegisterContent::InvalidLookupIndex, + QQmlJSRegisterContent::ScopeObject); if (irBinding.type() != QmlIR::Binding::Type_Script) { diagnose(u"Binding is not a script binding, but %1."_s.arg( @@ -272,7 +274,9 @@ QQmlJSCompilePass::Function QQmlJSFunctionInitializer::run( Q_UNUSED(functionName); QQmlJSCompilePass::Function function; - function.qmlScope = m_typeResolver->globalType(m_scopeType); + function.qmlScope = QQmlJSRegisterContent::create( + m_scopeType, QQmlJSRegisterContent::InvalidLookupIndex, + QQmlJSRegisterContent::ScopeObject); auto ast = astNode->asFunctionDefinition(); Q_ASSERT(ast); |
