Rename exported functions where name conflicts with param. (#8505)

This commit is contained in:
Logan Smyth 2018-08-21 13:54:29 -07:00 committed by GitHub
parent d07cef244e
commit b04de1196a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View File

@ -108,7 +108,7 @@ export default class Renamer {
path.isClassExpression(),
);
if (parentDeclar) {
const bindingIds = parentDeclar.getBindingIdentifiers();
const bindingIds = parentDeclar.getOuterBindingIdentifiers();
if (bindingIds[oldName] === binding.identifier) {
// When we are renaming an exported identifier, we need to ensure that
// the exported binding keeps the old name.

View File

@ -0,0 +1,2 @@
export function problem(problem) { }
void { problem: () => problem() };

View File

@ -0,0 +1,5 @@
{
"plugins": [
"transform-function-name"
]
}

View File

@ -0,0 +1,6 @@
function _problem(problem) {}
export { _problem as problem };
void {
problem: () => _problem()
};