(name, info, references)
| 1635 | * @returns {string | undefined} the new name or undefined if the name is not found |
| 1636 | */ |
| 1637 | const _findNewName = (name, info, references) => { |
| 1638 | const { usedNames, alreadyCheckedScopes } = getUsedNamesInScopeInfo( |
| 1639 | usedNamesInScopeInfo, |
| 1640 | info.module.identifier(), |
| 1641 | name |
| 1642 | ); |
| 1643 | if (allUsedNames.has(name) || usedNames.has(name)) { |
| 1644 | for (const ref of references) { |
| 1645 | addScopeSymbols( |
| 1646 | ref.from, |
| 1647 | usedNames, |
| 1648 | alreadyCheckedScopes, |
| 1649 | ignoredScopes |
| 1650 | ); |
| 1651 | } |
| 1652 | const newName = findNewName( |
| 1653 | name, |
| 1654 | allUsedNames, |
| 1655 | usedNames, |
| 1656 | info.module.readableIdentifier(requestShortener) |
| 1657 | ); |
| 1658 | allUsedNames.add(newName); |
| 1659 | info.internalNames.set(name, newName); |
| 1660 | topLevelDeclarations.add(newName); |
| 1661 | return newName; |
| 1662 | } |
| 1663 | }; |
| 1664 | |
| 1665 | /** |
| 1666 | * @param {string} name the name to find a new name for |
nothing calls this directly
no test coverage detected