Fixed inlining updating property use count

This commit is contained in:
Olivier Goffart 2024-08-22 16:36:06 +02:00
parent 5f77808d1c
commit 47028bce27
2 changed files with 2 additions and 2 deletions

View file

@ -318,7 +318,6 @@ impl SubComponent {
}
true
}
}
pub struct SubComponentInstance {

View file

@ -165,10 +165,11 @@ fn inline_simple_expressions_in_expression(expr: &mut Expression, ctx: &Evaluati
if let Some(prop_decl) = prop_info.property_decl {
prop_decl.use_count.set(prop_decl.use_count.get() - 1);
}
adjust_use_count(expr, &ctx, 1);
if use_count == 1 {
adjust_use_count(&binding.expression.borrow(), &mapped_ctx, -1);
binding.expression.replace(Expression::CodeBlock(vec![]));
} else {
adjust_use_count(expr, &ctx, 1);
}
}
}