Skip to content

Commit

Permalink
[compiler] Correctly insert (Arrow)FunctionExpressions
Browse files Browse the repository at this point in the history
Previously we would insert new (Arrow)FunctionExpressions as a sibling
of the original function. However this would break in the outlining case
as it would cause the original function expression's parent to become a
SequenceExpression, breaking a bunch of assumptions in the babel plugin.

To get around this, we synthesize a new VariableDeclaration to contain
the newly inserted function expression and therefore insert it as a true
sibling to the original function.

Yeah, it's kinda gross

ghstack-source-id: df13e3b439962b95af4bbd82ef4302624668faf7
Pull Request resolved: facebook#30446
  • Loading branch information
felixshiftellecon committed Jul 24, 2024
1 parent a6b7e43 commit e6fabaa
Showing 1 changed file with 271 additions and 255 deletions.
Loading

0 comments on commit e6fabaa

Please sign in to comment.