From ca9b6a7ebc75371c82748e057f55403518ebb5b1 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Wed, 12 Jun 2024 16:56:22 -0700 Subject: [PATCH] [compiler] Fix visitors to emit the correct kind Our passes aren't sequenced such that we could observe this bug, but this retains the proper terminal kind for pruned-scopes in mapTerminalSuccessors. ghstack-source-id: 1a03b40e45649bbef7d6db968fb2dbd6261a246a Pull Request resolved: https://github.com/facebook/react/pull/29884 --- .../packages/babel-plugin-react-compiler/src/HIR/visitors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts b/compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts index 632e665723..beda6e4a20 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts @@ -856,7 +856,7 @@ export function mapTerminalSuccessors( const block = fn(terminal.block); const fallthrough = fn(terminal.fallthrough); return { - kind: "scope", + kind: terminal.kind, scope: terminal.scope, block, fallthrough,