fix: 赋值表达式与对象属性函数名推断(function/class/arrow)

This commit is contained in:
2026-08-07 20:10:06 +08:00
parent 86615a3bef
commit 4734d7d3d5
2 changed files with 19 additions and 1 deletions
@@ -56,7 +56,12 @@ impl Emitter {
reg
};
let val_reg = self.emit_expression(&p.value, ctx)?;
if matches!(&p.value, Expression::ArrowFunctionExpression(_)) {
if matches!(
&p.value,
Expression::ArrowFunctionExpression(_)
| Expression::FunctionExpression(_)
| Expression::ClassExpression(_)
) {
if let Some(sub_mod) = ctx.nested.last_mut() {
sub_mod.function_name = Some(prop_name.to_string());
}