Skip to content

Commit

Permalink
Rename exported functions where name conflicts with param. (babel#8505)
Browse files Browse the repository at this point in the history
  • Loading branch information
loganfsmyth authored Aug 21, 2018
1 parent d07cef2 commit b04de11
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/babel-traverse/src/scope/lib/renamer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export function problem(problem) { }
void { problem: () => problem() };
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": [
"transform-function-name"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function _problem(problem) {}

export { _problem as problem };
void {
problem: () => _problem()
};

0 comments on commit b04de11

Please sign in to comment.