mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
cedaee5b03e94ee5f41f3683dd61d8e917fe29a2
Completes a todo for the `if` condition of scopes without any inputs. In this case since there are no inputs we can check for changes, we check if the first _output_ cache slot is set to the sentinel. For this to work we need to ensure that all scopes have at least one output, which isn't currently the case. Dead code can produce output-less sentinels. So this PR also adds a pass to find scopes w/o any outputs and convert them to regular blocks. We could in theory also just delete them, but for now let's be more conservative. This is something we'd want to highlight as a diagnostic in an IDE, though existing dead code linters would almost certainly find this case too.
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%