Merge pull request #3161 from loganfsmyth/function-rename-6781

Only rename outer function bindings on conflict - fixes T6781
This commit is contained in:
Logan Smyth 2015-12-13 23:44:43 -08:00
commit 7b25b33ac6
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;