Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Feb 27, 2025
1 parent 1da6694 commit fc30227
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions crates/swc_ecma_lints/src/rules/no_param_reassign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,33 @@ impl NoParamReassign {
.unwrap()
.insert(id.to_id());
}
Pat::Object(ObjectPat { props, .. }) => props.iter().for_each(|prop| {
match prop {
ObjectPatProp::Assign(AssignPatProp { key, .. }) => {
self.scoped_params
.get_mut(self.scopes.last().unwrap())
.unwrap()
.insert(key.to_id());
}
ObjectPatProp::KeyValue(KeyValuePatProp { value, .. }) => {
self.collect_function_params(value.as_ref());
Pat::Object(obj) => {
let ObjectPat { props, .. } = &**obj;

props.iter().for_each(|prop| {
match prop {
ObjectPatProp::Assign(AssignPatProp { key, .. }) => {
self.scoped_params
.get_mut(self.scopes.last().unwrap())
.unwrap()
.insert(key.to_id());
}
ObjectPatProp::KeyValue(KeyValuePatProp { value, .. }) => {
self.collect_function_params(value.as_ref());
}
_ => {}
};
});
}
Pat::Array(arr) => {
let ArrayPat { elems, .. } = &**arr;

elems.iter().for_each(|elem| {
if let Some(elem) = elem {
self.collect_function_params(elem);
}
_ => {}
};
}),
Pat::Array(ArrayPat { elems, .. }) => elems.iter().for_each(|elem| {
if let Some(elem) = elem {
self.collect_function_params(elem);
}
}),
});
}
_ => {}
}
}
Expand Down

0 comments on commit fc30227

Please sign in to comment.