From 4348eae1577bd72094d1ec1f6c2422c20288a3d9 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:14:25 +0000 Subject: [PATCH] refactor(transformer/typescript): re-order visitor methods (#6864) It makes more sense for `exit_statement` to be after `enter_statement`. --- crates/oxc_transformer/src/typescript/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/oxc_transformer/src/typescript/mod.rs b/crates/oxc_transformer/src/typescript/mod.rs index 4b2bf1a562e80..eab719a6db09a 100644 --- a/crates/oxc_transformer/src/typescript/mod.rs +++ b/crates/oxc_transformer/src/typescript/mod.rs @@ -205,14 +205,14 @@ impl<'a, 'ctx> Traverse<'a> for TypeScript<'a, 'ctx> { self.annotations.exit_statements(stmts, ctx); } - fn exit_statement(&mut self, stmt: &mut Statement<'a>, ctx: &mut TraverseCtx<'a>) { - self.annotations.exit_statement(stmt, ctx); - } - fn enter_statement(&mut self, stmt: &mut Statement<'a>, ctx: &mut TraverseCtx<'a>) { self.r#enum.enter_statement(stmt, ctx); } + fn exit_statement(&mut self, stmt: &mut Statement<'a>, ctx: &mut TraverseCtx<'a>) { + self.annotations.exit_statement(stmt, ctx); + } + fn enter_if_statement(&mut self, stmt: &mut IfStatement<'a>, ctx: &mut TraverseCtx<'a>) { self.annotations.enter_if_statement(stmt, ctx); }