Skip to content

Commit

Permalink
Revert "fix: block scope of for loop"
Browse files Browse the repository at this point in the history
This reverts commit ac85e9c.
  • Loading branch information
magic-akari committed Oct 14, 2024
1 parent ae4aac0 commit a39cd49
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,6 @@ impl<'a, 'b> PeepholeRemoveDeadCode {
} else {
var_decl = Some(ctx.ast.move_variable_declaration(var_init));
}
} else {
// block scope
// for(const/let x = 1; false; ) { ... }
var_decl = None;
}
}

Expand Down Expand Up @@ -373,8 +369,6 @@ mod test {
fold("for (var se = [1, 2]; false;);", "var se = [1, 2];");
fold("for (var se = [1, 2]; false;) { var a = 0; }", "var se = [1, 2], a;");

fold("for (let se = [1, 2]; false;) { var a = 0; }", "");

// fold("l1:for(;false;) { }", "");
}

Expand Down

0 comments on commit a39cd49

Please sign in to comment.