diff --git a/src/babel/traversal/path.js b/src/babel/traversal/path.js index 6aa5364838..d3b11a830a 100644 --- a/src/babel/traversal/path.js +++ b/src/babel/traversal/path.js @@ -89,22 +89,7 @@ export default class TraversalPath { } refreshScope(oldNode, newNodes) { - var scope = this.scope; - if (!scope) return; - - if (!t.isAssignmentExpression(oldNode)) { - var bindings = t.getBindingIdentifiers(oldNode); - for (var key in bindings) { - if (scope.bindingIdentifierEquals(key, bindings[key])) { - scope.removeBinding(key); - } - } - } - - for (let i = 0; i < newNodes.length; i++) { - var newNode = newNodes[i]; - scope.refreshDeclaration(newNode); - } + // todo } refresh() { @@ -151,7 +136,7 @@ export default class TraversalPath { } this.flatten(); - // TODO: duplicate internal metadata + // TODO: duplicate internal path metadata across the new node paths } } diff --git a/src/babel/traversal/scope.js b/src/babel/traversal/scope.js index 1ab1be6245..9ae4636781 100644 --- a/src/babel/traversal/scope.js +++ b/src/babel/traversal/scope.js @@ -864,7 +864,7 @@ export default class Scope { */ removeOwnBinding(name) { - delete this.bindings[name]; + this.bindings[name] = null; } /** @@ -875,7 +875,6 @@ export default class Scope { removeBinding(name) { var info = this.getBindingInfo(name); - if (!info) return; - info.scope.removeOwnBinding(name); + if (info) info.scope.removeOwnBinding(name); } }