llr inlining: fix checking of builtin global properties

This commit is contained in:
Olivier Goffart 2022-02-16 18:23:57 +01:00 committed by Olivier Goffart
parent 85e88eb3d6
commit 6f3668324f
2 changed files with 13 additions and 2 deletions

View file

@ -516,6 +516,16 @@ fn lower_global(
state
.global_properties
.insert(nr, PropertyReference::Global { global_index, property_index });
prop_analysis.push(
global
.root_element
.borrow()
.property_analysis
.borrow()
.get(p)
.cloned()
.unwrap_or_default(),
);
}
true
} else {

View file

@ -196,8 +196,9 @@ fn property_binding_and_analysis<'a>(
let g = &ctx.public_component.globals[*global_index];
return (
Some(&g.prop_analysis[*property_index]),
g.init_values[*property_index]
.as_ref()
g.init_values
.get(*property_index)
.and_then(Option::as_ref)
.map(|b| (b, ContextMap::InGlobal(*global_index))),
);
}