From e74163450ba1e79b320075d8303911369274bd37 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Thu, 31 Jul 2025 09:56:48 +0000 Subject: [PATCH] refactor(semantic): move comments (#12658) Pure refactor. Move 2 comments to precede the code the comments are relevant to. --- crates/oxc_semantic/src/builder.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/oxc_semantic/src/builder.rs b/crates/oxc_semantic/src/builder.rs index 1eff295ccafc7..67616cf9b30ff 100644 --- a/crates/oxc_semantic/src/builder.rs +++ b/crates/oxc_semantic/src/builder.rs @@ -1596,6 +1596,8 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> { fn visit_function(&mut self, func: &Function<'a>, flags: ScopeFlags) { /* cfg */ + // We add a new basic block to the cfg before entering the node + // so that the correct cfg_ix is associated with the ast node. let (before_function_graph_ix, error_harness, function_graph_ix) = control_flow!(self, |cfg| { let before_function_graph_ix = cfg.current_node_ix; @@ -1607,8 +1609,6 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> { }); /* cfg */ - // We add a new basic block to the cfg before entering the node - // so that the correct cfg_ix is associated with the ast node. let kind = AstKind::Function(self.alloc(func)); self.enter_node(kind); self.function_stack.push(self.current_node_id); @@ -1696,6 +1696,8 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> { fn visit_arrow_function_expression(&mut self, expr: &ArrowFunctionExpression<'a>) { /* cfg */ + // We add a new basic block to the cfg before entering the node + // so that the correct cfg_ix is associated with the ast node. let (current_node_ix, error_harness, function_graph_ix) = control_flow!(self, |cfg| { let current_node_ix = cfg.current_node_ix; cfg.push_finalization_stack(); @@ -1706,8 +1708,6 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> { }); /* cfg */ - // We add a new basic block to the cfg before entering the node - // so that the correct cfg_ix is associated with the ast node. let kind = AstKind::ArrowFunctionExpression(self.alloc(expr)); self.enter_node(kind); self.function_stack.push(self.current_node_id);