Rename exported functions where name conflicts with param. (#8505)
This commit is contained in:
parent
d07cef244e
commit
b04de1196a
@ -108,7 +108,7 @@ export default class Renamer {
|
|||||||
path.isClassExpression(),
|
path.isClassExpression(),
|
||||||
);
|
);
|
||||||
if (parentDeclar) {
|
if (parentDeclar) {
|
||||||
const bindingIds = parentDeclar.getBindingIdentifiers();
|
const bindingIds = parentDeclar.getOuterBindingIdentifiers();
|
||||||
if (bindingIds[oldName] === binding.identifier) {
|
if (bindingIds[oldName] === binding.identifier) {
|
||||||
// When we are renaming an exported identifier, we need to ensure that
|
// When we are renaming an exported identifier, we need to ensure that
|
||||||
// the exported binding keeps the old name.
|
// the exported binding keeps the old name.
|
||||||
|
|||||||
2
packages/babel-traverse/test/fixtures/rename/property-rename-with-export/input.mjs
vendored
Normal file
2
packages/babel-traverse/test/fixtures/rename/property-rename-with-export/input.mjs
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export function problem(problem) { }
|
||||||
|
void { problem: () => problem() };
|
||||||
5
packages/babel-traverse/test/fixtures/rename/property-rename-with-export/options.json
vendored
Normal file
5
packages/babel-traverse/test/fixtures/rename/property-rename-with-export/options.json
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
"transform-function-name"
|
||||||
|
]
|
||||||
|
}
|
||||||
6
packages/babel-traverse/test/fixtures/rename/property-rename-with-export/output.mjs
vendored
Normal file
6
packages/babel-traverse/test/fixtures/rename/property-rename-with-export/output.mjs
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
function _problem(problem) {}
|
||||||
|
|
||||||
|
export { _problem as problem };
|
||||||
|
void {
|
||||||
|
problem: () => _problem()
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user