mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
2e501b0f01df960b3ed7cc63df3d7a208220c25d
Per design discussion, this PR changes BuildHIR to maintain the invariant that, for each distinct variable in the input, that all references to that variable in the HIR will have the same unique `name` _and_ same unique `id`. Phrased differently: Identifiers with the same id will have the same name and vice-versa. This isn't an invariant we maintain throughout compilation — SSA form changes the `id`s — but crucially, ensuring that the `name` is also unique allows us to understand later which identifiers referred to the same original variable and which were different. Follow-up PRs will ensure that we maintain variable identifiers in the output as well, in all cases except shadowing (and for shadowing, we'll rewrite identifiers inside lambdas).
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%