Skip to content

Convert nested arrow functions to anonymous functions in a single pass - #413

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-arrow-function-single-pass
Oct 19, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-arrow-function-single-pass

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

When an arrow function body is itself an arrow function, convert the inner one in the same pass instead of leaving it for another traverse.

A deeply nested chain (fn() => fn() => fn() => ...) previously needed one pass per level. With the rector-src fixed-point loop now capped, a chain deeper than the cap would fail to stabilize. Handling the nested case inline downgrades the whole chain in one pass.

Output is unchanged - the existing nested_static_fn_uses fixtures (including toomany, mixed, sameParamName) pass as before.

@TomasVotruba
TomasVotruba merged commit faf6cf5 into main Oct 19, 2026
9 checks passed
@TomasVotruba
TomasVotruba deleted the tv-arrow-function-single-pass branch October 19, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant