Unverified Commit a4d907a5 authored by JH.Lee's avatar JH.Lee Committed by GitHub

refactor(next/swc): remove unnecessary field in `RemoveConsole` (#40296)

This PR removes `in_function_params` field in `RemoveConsole` module.

It's an unnecessary field that does not affect the module.
parent 0c586217
...@@ -34,7 +34,6 @@ pub struct Options { ...@@ -34,7 +34,6 @@ pub struct Options {
struct RemoveConsole { struct RemoveConsole {
exclude: Vec<JsWord>, exclude: Vec<JsWord>,
bindings: Vec<AHashSet<Id>>, bindings: Vec<AHashSet<Id>>,
in_function_params: bool,
} }
impl RemoveConsole { impl RemoveConsole {
...@@ -91,12 +90,10 @@ impl Fold for RemoveConsole { ...@@ -91,12 +90,10 @@ impl Fold for RemoveConsole {
} }
fn fold_function(&mut self, mut func: Function) -> Function { fn fold_function(&mut self, mut func: Function) -> Function {
self.in_function_params = true;
let mut new_params: AHashSet<Id> = AHashSet::default(); let mut new_params: AHashSet<Id> = AHashSet::default();
for param in &func.params { for param in &func.params {
new_params.extend(collect_top_level_decls(param)); new_params.extend(collect_top_level_decls(param));
} }
self.in_function_params = false;
self.bindings.push(new_params); self.bindings.push(new_params);
self.bindings.push(collect_top_level_decls(&func)); self.bindings.push(collect_top_level_decls(&func));
...@@ -129,6 +126,5 @@ pub fn remove_console(config: Config) -> impl Fold { ...@@ -129,6 +126,5 @@ pub fn remove_console(config: Config) -> impl Fold {
RemoveConsole { RemoveConsole {
exclude, exclude,
bindings: Default::default(), bindings: Default::default(),
in_function_params: false,
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment