mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
5db523a98a617842bb45500ff82491184d8ecacd
When collecting the output of each scope I was checking to see whether each operand was being used after the end of the _current_ scope. What we really want to be checking is whether the operand is used after _the scope in which it's defined_. Those are the same thing when there is no nesting, involved, so the previous logic worked for most examples. It isn't super easy to tell when if the operand's scope has ended, because we don't always know what the "current" InstructionId is inside a ReactiveFunction. And that in turn isn't quite so easy to change, because of some edge cases like break statements that we synthesize. The solution here is to track the set of active scopes, and if an operand is used and its scope is not active then voila, it's scope must have completed and its an output.
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%