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
@@ -405,6 +405,14 @@ fn compile_closure_capture_arrow_emits_make_cell() {
);
}
#[test]
fn compile_adjacent_for_of_lexical_bindings_in_distinct_scopes() {
let module = compile_source(
"for (const [arg, descr] of [[1, 'a']]) { descr; } for (const [arg, descr] of [[2, 'b']]) { descr; }",
);
assert!(!module.bytecode.is_empty());
}
#[test]
fn compile_compound_assignment_complement_ops() {
let module = compile_source("let x = 10; x -= 1; x *= 2; x /= 3; x %= 4;");