LLR: Fix some issues with globals

This commit is contained in:
Olivier Goffart 2022-01-10 14:21:29 +01:00 committed by Olivier Goffart
parent 6a8261366e
commit 933e580618

View file

@ -421,7 +421,9 @@ fn lower_global(
); );
properties.push(Property { name: p.clone(), ty: x.property_type.clone() }); properties.push(Property { name: p.clone(), ty: x.property_type.clone() });
if !matches!(x.property_type, Type::Callback { .. }) {
const_properties.push(nr.is_constant()); const_properties.push(nr.is_constant());
}
state state
.global_properties .global_properties
.insert(nr.clone(), PropertyReference::Global { global_index, property_index }); .insert(nr.clone(), PropertyReference::Global { global_index, property_index });
@ -464,7 +466,7 @@ fn lower_global(
let public_properties = public_properties(global, &mapping, &state); let public_properties = public_properties(global, &mapping, &state);
GlobalComponent { GlobalComponent {
name: global.id.clone(), name: global.root_element.borrow().id.clone(),
properties, properties,
init_values, init_values,
const_properties, const_properties,