fix: capture object keys and scope loop bindings

This commit is contained in:
爱特每羊队
2026-08-11 14:17:45 +08:00
parent 925ca358e9
commit ec2efa7b6b
8 changed files with 77 additions and 10 deletions
+9 -4
View File
@@ -187,11 +187,16 @@ impl Emitter {
}
Expression::ObjectExpression(obj) => {
for prop in &obj.properties {
if let oxide_parser::ObjectPropertyKind::ObjectProperty(p) = prop {
if p.computed {
self.pre_scan_builtin_expr(p.key.to_expression(), ctx);
match prop {
oxide_parser::ObjectPropertyKind::ObjectProperty(p) => {
if p.computed {
self.pre_scan_builtin_expr(p.key.to_expression(), ctx);
}
self.pre_scan_builtin_expr(&p.value, ctx);
}
oxide_parser::ObjectPropertyKind::SpreadProperty(spread) => {
self.pre_scan_builtin_expr(&spread.argument, ctx);
}
self.pre_scan_builtin_expr(&p.value, ctx);
}
}
}