Skip to content

Commit

Permalink
refactor(transformer): reorder methods in arrow function transform (#…
Browse files Browse the repository at this point in the history
…5830)

Pure refactor. Just move methods which push/pop to stacks to the top, so they're all together.
  • Loading branch information
overlookmotel committed Sep 18, 2024
1 parent 172fa03 commit 03a9e1a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/oxc_transformer/src/es2015/arrow_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ impl<'a> Traverse<'a> for ArrowFunctions<'a> {
self.inside_arrow_function_stack.pop().unwrap();
}

fn enter_class(&mut self, _class: &mut Class<'a>, _ctx: &mut TraverseCtx<'a>) {
self.inside_arrow_function_stack.push(false);
}

fn exit_class(&mut self, _class: &mut Class<'a>, _ctx: &mut TraverseCtx<'a>) {
self.inside_arrow_function_stack.pop().unwrap();
}

fn enter_jsx_element_name(
&mut self,
element_name: &mut JSXElementName<'a>,
Expand Down Expand Up @@ -213,14 +221,6 @@ impl<'a> Traverse<'a> for ArrowFunctions<'a> {
}
}

fn enter_class(&mut self, _class: &mut Class<'a>, _ctx: &mut TraverseCtx<'a>) {
self.inside_arrow_function_stack.push(false);
}

fn exit_class(&mut self, _class: &mut Class<'a>, _ctx: &mut TraverseCtx<'a>) {
self.inside_arrow_function_stack.pop().unwrap();
}

fn enter_variable_declarator(
&mut self,
node: &mut VariableDeclarator<'a>,
Expand Down

0 comments on commit 03a9e1a

Please sign in to comment.