mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
717719b8ea6dfb248b5cffa0224641f18de11d61
After some painful debugging I isolated the infinite loop when attempting to use the BabelPlugin in hir-test rather than manually parsing and traversing it. The issue is that in the BabelPlugin we were replacing the original FunctionDeclaration with a new one, which would add it to Babel's traversal queue. This would effectively create an infinite loop where we would try to optimize a function that was already compiled by Forget (aside: _should_ running the compiler multiple times on code work?). To get around this we can just call the handy `skip` method on the new FunctionDeclaration to tell Babel to stop traversing it. I'm also moving the scope check here because I'll remove it from hir-test in a later commit.
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%