dillon1000/react
Commit
Browse files Fix infinite loop in BabelPlugin
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.
Changed paths1 file
First-parent comparisoncompiler/forget/src/Babel/BabelPlugin.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…