Skip to content

Commit 21b36e8

Browse files
brad4dcopybara-github
authored andcommitted
Improve MakeDeclaredNamesUnique#ContextualRenameInverter
`ContextualRenameInverter` tries to restore the original names to variables that were previously renamed by `MakeDeclaredNamesUnique`. This change is a complete rewrite of its implementation. 1. Be smarter about renaming. The old implementation would fail to rename in many cases where restoring the original name is perfectly safe. The changes to the unit test demonstrate this. 2. Also do some reformatting to meet our current standards. I am doing this now in order to enable full normalization renaming in transpile-only mode. I discovered that the previous algorithm failed to restore names of function parameters, which broke runtime parameter injection by Angular which depends on the exact parameter names. The new algorithm successfully restores those parameter names. PiperOrigin-RevId: 551419411
1 parent db7ed63 commit 21b36e8

File tree

3 files changed

+430
-135
lines changed

3 files changed

+430
-135
lines changed

0 commit comments

Comments
 (0)