Only rename outer function bindings on conflict - fixes T6781

This commit is contained in:
Logan Smyth 2015-12-13 15:34:47 -08:00
parent 9c88b8797e
commit afcfba2075
3 changed files with 9 additions and 1 deletions

View File

@ -16,4 +16,8 @@ function f() {
b;
}
};
function commit(b) {
b();
}
});

View File

@ -16,4 +16,8 @@ function _f() {
_b;
}
};
function commit(b) {
b();
}
});

View File

@ -15,7 +15,7 @@ let renameVisitor = {
},
"AssignmentExpression|Declaration"(path, state) {
let ids = path.getBindingIdentifiers();
let ids = path.getOuterBindingIdentifiers();
for (let name in ids) {
if (name === state.oldName) ids[name].name = state.newName;