Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
CPunisher committed Jul 8, 2024
1 parent 96f7139 commit 84fb416
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ impl BlockScoping {
}

fn mark_as_used(&mut self, i: Id) {
// Only consider the variable used in a non-ScopeKind::Loop, which means it is
// captured in a closure
for scope in self
.scope
.iter_mut()
Expand Down Expand Up @@ -127,16 +129,6 @@ impl BlockScoping {
fn handle_capture_of_vars(&mut self, body: &mut Box<Stmt>) {
let body_stmt = &mut **body;

// {
// let mut v = FunctionFinder { found: false };
// body_stmt.visit_with(&mut v);
// if !v.found {
// self.scope.pop();
// return;
// }
// }

//
if let Some(ScopeKind::Loop {
args,
used,
Expand Down

0 comments on commit 84fb416

Please sign in to comment.