Files
react/compiler/packages
Joe Savona 2f65d3d545 [compiler][wip] Support finally clauses
First pass at adding support for `finally` clauses. I took a simple approach where we reify the JS semantics around return shadowing in the HIR and output. Ie, we create a temporary variable that will be the return value, and change returns in the try/catch to assign to that value and then break to the finalizer. In the finalizer returns work as normal, but we put a final extra "if temporary set, return it" statement. It would be more ideal to fully restore the return shadowing, but given that finally clauses are relatively rare this seems like a reasonable compromise.

I need to do more analysis to make sure the approach is correct.
2026-01-23 11:07:43 -08:00
..