Skip to content

Commit

Permalink
Revert to drain + collect
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Jul 30, 2024
1 parent f4ba88b commit 9ef71f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use std::{
cell::{Cell, RefCell},
mem,
path::PathBuf,
sync::Arc,
};
Expand All @@ -29,7 +28,7 @@ use crate::{
module_record::ModuleRecordBuilder,
node::{AstNodeId, AstNodes, NodeFlags},
reference::{Reference, ReferenceFlag, ReferenceId},
scope::{ScopeFlags, ScopeId, ScopeTree},
scope::{Bindings, ScopeFlags, ScopeId, ScopeTree},
symbol::{SymbolFlags, SymbolId, SymbolTable},
unresolved_stack::UnresolvedReferencesStack,
JSDocFinder, Semantic,
Expand Down Expand Up @@ -678,7 +677,8 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> {
// Move all bindings from catch clause param scope to catch clause body scope
// to make it easier to resolve references and check redeclare errors
if self.scope.get_flags(parent_scope_id).is_catch_clause() {
let parent_bindings = mem::take(self.scope.get_bindings_mut(parent_scope_id));
let parent_bindings =
self.scope.get_bindings_mut(parent_scope_id).drain(..).collect::<Bindings>();
*self.scope.get_bindings_mut(self.current_scope_id) = parent_bindings;
}

Expand Down

0 comments on commit 9ef71f7

Please sign in to comment.