Add support for protected functions

Protected function can only be called from the direct base

Issue #3636
This commit is contained in:
Olivier Goffart 2023-10-10 14:45:32 +02:00 committed by Olivier Goffart
parent 351ae4b93c
commit 8f001ac490
11 changed files with 142 additions and 17 deletions

View file

@ -413,6 +413,7 @@ impl ElementType {
property_visibility: PropertyVisibility::Private,
declared_pure: None,
is_local_to_component: false,
is_in_direct_base: false,
}
} else {
crate::typeregister::reserved_property(name)
@ -424,6 +425,7 @@ impl ElementType {
property_visibility: p.property_visibility,
declared_pure: None,
is_local_to_component: false,
is_in_direct_base: false,
},
}
}
@ -441,6 +443,7 @@ impl ElementType {
property_visibility: PropertyVisibility::InOut,
declared_pure: None,
is_local_to_component: false,
is_in_direct_base: false,
}
}
_ => PropertyLookupResult {
@ -449,6 +452,7 @@ impl ElementType {
property_visibility: PropertyVisibility::Private,
declared_pure: None,
is_local_to_component: false,
is_in_direct_base: false,
},
}
}
@ -705,6 +709,8 @@ pub struct PropertyLookupResult<'a> {
pub declared_pure: Option<bool>,
/// True if the property is part of the the current component (for visibility purposes)
pub is_local_to_component: bool,
/// True if the property in the direct base of the component (for visibility purposes)
pub is_in_direct_base: bool,
}
impl<'a> PropertyLookupResult<'a> {