Skip to content

Commit

Permalink
chore: s/elimintation/elimination/
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Aug 6, 2024
1 parent e42ac3a commit 451ac4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_minifier/src/ast_passes/remove_dead_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct RemoveDeadCode<'a> {
impl<'a> VisitMut<'a> for RemoveDeadCode<'a> {
fn visit_statements(&mut self, stmts: &mut Vec<'a, Statement<'a>>) {
stmts.retain(|stmt| !matches!(stmt, Statement::EmptyStatement(_)));
self.dead_code_elimintation(stmts);
self.dead_code_elimination(stmts);
walk_mut::walk_statements(self, stmts);
}

Expand All @@ -34,7 +34,7 @@ impl<'a> RemoveDeadCode<'a> {
}

/// Removes dead code thats comes after `return` statements after inlining `if` statements
fn dead_code_elimintation(&mut self, stmts: &mut Vec<'a, Statement<'a>>) {
fn dead_code_elimination(&mut self, stmts: &mut Vec<'a, Statement<'a>>) {
// Remove code after `return` and `throw` statements
let mut index = None;
'outer: for (i, stmt) in stmts.iter().enumerate() {
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_minifier/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl CompressOptions {
}
}

pub fn dead_code_elimintation() -> Self {
pub fn dead_code_elimination() -> Self {
Self {
remove_syntax: true,
fold_constants: true,
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_minifier/tests/oxc/remove_dead_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn print(source_text: &str, remove_dead_code: bool) -> String {
let ret = Parser::new(&allocator, source_text, source_type).parse();
let program = allocator.alloc(ret.program);
if remove_dead_code {
Compressor::new(&allocator, CompressOptions::dead_code_elimintation()).build(program);
Compressor::new(&allocator, CompressOptions::dead_code_elimination()).build(program);
}
CodeGenerator::new()
.with_options(CodegenOptions { single_quote: true })
Expand Down

0 comments on commit 451ac4d

Please sign in to comment.