diff --git a/lib/6to5/traversal/scope.js b/lib/6to5/traversal/scope.js index 47df9504f7..55f4ebca48 100644 --- a/lib/6to5/traversal/scope.js +++ b/lib/6to5/traversal/scope.js @@ -159,6 +159,11 @@ Scope.prototype.rename = function (oldName, newName) { enter: function (node, parent, scope) { if (t.isReferencedIdentifier(node, parent) && node.name === oldName) { node.name = newName; + } else if (t.isDeclaration(node)) { + var ids = t.getBindingIdentifiers(node); + for (var name in ids) { + if (name === oldName) ids[name].name = newName; + } } else if (t.isScope(node, parent)) { if (!scope.bindingIdentifierEquals(oldName, binding)) { this.skip();