[compiler] Visit nested scopes in pruned scopes in PromoteUsedTemporaries

While debugging #30536 I happened to notice that the bug only reproduced
when there was interleaving scopes, and observed that an unpruned scope
nested inside of a pruned one was not being visited by
CollectPromotableTemporaries, which keeps track of which identifiers
should be promoted later. Therefore when actually promoting temporaries
we were skipping over the identifiers in children of pruned scopes

ghstack-source-id: d805f62f22
Pull Request resolved: https://github.com/facebook/react/pull/30537
This commit is contained in:
Lauren Tan
2024-07-30 17:05:23 -04:00
parent edfaa99f01
commit d06196c1cd
5 changed files with 104 additions and 137 deletions
@@ -138,6 +138,7 @@ class CollectPromotableTemporaries extends ReactiveFunctionVisitor<State> {
usedOutsideScope: false,
});
}
this.visitBlock(scopeBlock.instructions, state);
}
override visitScope(scopeBlock: ReactiveScopeBlock, state: State): void {