From 56b6a795a4ef97b2b340a85d29629dc43c351d56 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 9 Mar 2015 23:09:22 +1100 Subject: [PATCH] remove path.refreshScope until i'm more confident on it's functionality so it doesn't break peopls stuff --- src/babel/traversal/path.js | 19 ++----------------- src/babel/traversal/scope.js | 5 ++--- 2 files changed, 4 insertions(+), 20 deletions(-) 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); } }