remove path.refreshScope until i'm more confident on it's functionality so it doesn't break peopls stuff

This commit is contained in:
Sebastian McKenzie 2015-03-09 23:09:22 +11:00
parent 17b34a2959
commit 56b6a795a4
2 changed files with 4 additions and 20 deletions

View File

@ -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
}
}

View File

@ -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);
}
}