mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[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:
+1
@@ -138,6 +138,7 @@ class CollectPromotableTemporaries extends ReactiveFunctionVisitor<State> {
|
||||
usedOutsideScope: false,
|
||||
});
|
||||
}
|
||||
this.visitBlock(scopeBlock.instructions, state);
|
||||
}
|
||||
|
||||
override visitScope(scopeBlock: ReactiveScopeBlock, state: State): void {
|
||||
|
||||
Reference in New Issue
Block a user