fix(react-compiler): preserve outer lexical captures in outlined functions - #26589
Open
dexhunter wants to merge 2 commits into
Open
fix(react-compiler): preserve outer lexical captures in outlined functions#26589dexhunter wants to merge 2 commits into
dexhunter wants to merge 2 commits into
Conversation
…tions Fixes oxc-project#26519 Co-Authored-By: Aiden <[email protected]>
Fixes oxc-project#26519 Co-Authored-By: Aiden <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #26519.
When function outlining is enabled, a callback returned by a factory can be moved to module scope even though it reads the factory's options. The generated application then raises
ReferenceError: options is not definedbefore reachingCHART_READY.This change tracks references outside the outlined function's lexical scope and keeps the affected callback inline when outlining would move it beyond the factory's scope. Safe module/global cases and function-declaration outlining remain available.
Validation:
options is not definedfailure while the disabled arm reachesCHART_READY.CHART_READY, and report no page errors. The frozen fixture files remain unchanged.cargo shearcheck was unavailable and is not claimed as run.AI tools were used for implementation and evaluation preparation, with Luna authoring the change and Astra coordinating the evaluation. The code and results were separately reviewed against the repository source and validation receipts.
This is a correctness fix; no performance improvement is claimed.
Evaluation trajectory